Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: boolean as ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3066 of 3322
Post > Topic >>

Re: boolean as 0 and 1

by shoaibmir@[EMAIL PROTECTED] ("Shoaib Mir") Apr 8, 2008 at 07:59 PM

------=_Part_14312_18765828.1207648755649
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, Apr 8, 2008 at 7:54 PM, A B <gentosaker@[EMAIL PROTECTED]
> wrote:

> Hi,
> Is there a way to make postgresql to automatically convert integer
> values to boolean?
>
> Consider
>
> create table x (a boolean);
> insert into x (a) values (1);
>
> the inser fails :-(
> Is there a way to make it work without altering the insert command?
>
>

Creating a custom cast might help you there....

--
Shoaib Mir
Fujitsu Australia Software Technology
shoaibm@[EMAIL PROTECTED]
 text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<br><br>
<div class="gmail_quote">On Tue, Apr 8, 2008 at 7:54 PM, A B &lt;<a
href="mailto:gentosaker@[EMAIL PROTECTED]
">gentosaker@[EMAIL PROTECTED]
>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px
0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br>Is there a way to make
postgresql to automatically convert integer<br>values to
boolean?<br><br>Consider<br>
<br>create table x (a boolean);<br>insert into x (a) values
(1);<br><br>the inser fails :-(<br>Is there a way to make it work without
altering the insert command?<br><font
color="#888888"><br></font></blockquote>
<div>&nbsp;</div></div>
<div class="gmail_quote">&nbsp;</div>
<div class="gmail_quote">Creating a custom cast might help you
there....<br>&nbsp;<br>--<br>Shoaib Mir<br>Fujitsu Australia Software
Technology<br><a
href="mailto:shoaibm@[EMAIL PROTECTED]
">shoaibm@[EMAIL PROTECTED]
></div>

------=_Part_14312_18765828.1207648755649--
 




 4 Posts in Topic:
boolean as 0 and 1
gentosaker@[EMAIL PROTECT  2008-04-08 11:54:09 
Re: boolean as 0 and 1
shoaibmir@[EMAIL PROTECTE  2008-04-08 19:59:15 
Re: boolean as 0 and 1
shoaibmir@[EMAIL PROTECTE  2008-04-08 20:03:20 
Re: boolean as 0 and 1
aarni@[EMAIL PROTECTED]   2008-04-08 13:06:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 3:41:57 CST 2008.