Skip site navigation (1) Skip section navigation (2)

Re: Binary data type with other output method

From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Binary data type with other output method
Date: 2007-12-26 17:18:22
Message-ID: 20071226181822.16162953@iridium.wars-nicht.de (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello,

On Tue, 25 Dec 2007 20:11:45 -0500 Tom Lane wrote:

> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I think you'd really need a separate type.  But have you considered
> something simple like
> 	CREATE DOMAIN boolint AS int CHECK (value = 0 OR value = 1)

i considered this one but this would only bring 0/1 as input, not as
output values, which is what i want.

The reason for my question is: PHP (yes *grumble*) does not recognize
boolean columns but instead makes a simple string from a PG boolean.

So every time you select a boolean column in PHP, you cannot use
expressions like:

if (!$bool)

because 't' and 'f' give TRUE in PHP.

I was begged many times by our people coding PHP to find a workaround
for this problem.


Kind regards

-- 
				Andreas 'ads' Scherbaum
German PostgreSQL User Group

In response to

Responses

pgsql-hackers by date

Next:From: Mark MielkeDate: 2007-12-26 22:12:33
Subject: Re: Binary data type with other output method
Previous:From: Andrew DunstanDate: 2007-12-26 01:36:23
Subject: Re: Binary data type with other output method

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group