On Wed, Oct 31, 2012 at 8:08 PM, Raghavendra
wrote:
> False represented by zero bytes and True by 1 byte with value 1.
This is not true AFAIK. Both boolean TRUE and FALSE values require 1 byte.
A NULL value is zero bytes (though it still consumes 1 bit in the null
bitmap). This is true for all t
On 11/01/2012 02:25 AM, Mike Christensen wrote:
> It would also matter what columns were next to it, correct?
It doesn't look like PostgreSQL packs booleans. It still matters what's
next to it because of the alignment requirements of other data types,
but you still have a minimum of one byte per bo
It would also matter what columns were next to it, correct?
For example, if you had 4 bools in a row, that could also be 1 byte..
On Wed, Oct 31, 2012 at 11:08 AM, Raghavendra <
raghavendra@enterprisedb.com> wrote:
> On Wed, Oct 31, 2012 at 8:52 PM, Alexander Gataric wrote:
>
>> What is the
On Wed, Oct 31, 2012 at 8:52 PM, Alexander Gataric wrote:
> What is the data physically stored as for boolean type? I know that it is
> one byte but is it char, int, or something else?
>
False represented by zero bytes and True by 1 byte with value 1.
---
Regards,
Raghavendra
EnterpriseDB Corp
Dominik Sander writes:
> I have an issue with a table partitioned by one boolean column. The
> query planner only seems to skip the non matching table if expired
> (the column I use for the partition) is true.
Hm, interesting case. The reason it's behaving asymmetrically is the
fix for this bug:
Simon Riggs writes:
> It might be possible to make BOOLEAN NOT NULL use the null bit to
> represent the actual data value and then have the column use no
> additional bytes, except when we don't store the null bitmap at all.
> Just needs people to make it happen cleanly, if that's possible.
I rea
On Thu, 2009-10-01 at 12:03 +0100, Sam Mason wrote:
> > However, I see that a boolean takes up 1
> > byte of storage, which is 8 bits. Is this due to the fact that the value
> > can be null?
>
> I believe it's more to do with the fact that if you add a boolean column
> and then subsequently an
2009/10/1 Sam Mason
>
> bool_or and bool_and are aggregates that work over boolean data types.
>
>
Ah yes, that makes total sense! I knew max wouldn't be logical in such as
case, but couldn't think of the alternative. Thanks!
>
> I believe it's more to do with the fact that if you add a boole
On Thu, Oct 01, 2009 at 11:37:40AM +0100, Thom Brown wrote:
> I've read the PostgreSQL documentation page on the boolean datatype (
> http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out
> what PostgreSQL's definition of a boolean is, as I believe it is distinctive
> from a
> Kev <[EMAIL PROTECTED]> writes:
> > ...because the case should force it to only evaluate 'old' when
> > TG_OP
> > = 'UPDATE' and otherwise ('INSERT') skip through to 't'. But this
> > causes the same error on insert. I suspect it's because the select
> > query gets parameterized and at that p
Kev <[EMAIL PROTECTED]> writes:
> ...because the case should force it to only evaluate 'old' when TG_OP
> = 'UPDATE' and otherwise ('INSERT') skip through to 't'. But this
> causes the same error on insert. I suspect it's because the select
> query gets parameterized and at that point the 'old'
On 2/20/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Merlin Moncure" <[EMAIL PROTECTED]> writes:
> On 2/19/07, Tom Lane <[EMAIL PROTECTED]> wrote:
>> "Merlin Moncure" <[EMAIL PROTECTED]> writes:
>>> # select ((now() - '1 day'::interval)::timestamp - now()) < 0;
>>> ?column?
>>> --
>>> f <--
"Merlin Moncure" <[EMAIL PROTECTED]> writes:
> On 2/19/07, Tom Lane <[EMAIL PROTECTED]> wrote:
>> "Merlin Moncure" <[EMAIL PROTECTED]> writes:
>>> # select ((now() - '1 day'::interval)::timestamp - now()) < 0;
>>> ?column?
>>> --
>>> f <-- looks busted to me
>>> (1 row)
>>
>> If you'd ca
--Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Merlin Moncure
Sent: Tuesday, February 20, 2007 8:30 AM
To: Tom Lane
Cc: postgres general
Subject: Re: [GENERAL] boolean operator on interval producing strange
results
On 2/19/07, Tom Lane <[EMAIL P
On 2/19/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Merlin Moncure" <[EMAIL PROTECTED]> writes:
> # select ((now() - '1 day'::interval)::timestamp - now()) < 0;
> ?column?
> --
> f <-- looks busted to me
> (1 row)
If you'd casted to timestamptz then I'd agree this is busted.
As-is, it m
"Merlin Moncure" <[EMAIL PROTECTED]> writes:
> # select ((now() - '1 day'::interval)::timestamp - now()) < 0;
> ?column?
> --
> f <-- looks busted to me
> (1 row)
If you'd casted to timestamptz then I'd agree this is busted.
As-is, it might have something to do with your timezone setti
Mr. Fuhr,
Thanks for your quick response. In fact, the problem doesn't occur in
psql or in EMS PostgreSQL Manager. It appears unique to pgAdmin III.
In the future, I'll check such things with psql before asking a (potentially
dumb) question. Again, thanks!
Michael Schmidt
On Sun, Aug 28, 2005 at 03:31:17PM -0600, Michael Schmidt wrote:
> I've not been able to find anything on this in the groups or by
> Google. I have a table with several boolean columns, all not null and
> with either 'true' or 'false' as default values. I've been testing the
> system in pgAdmin I
Tom Lane <[EMAIL PROTECTED]> writes:
> There was some talk awhile ago of preventing flattening when the
> subquery targetlist contains volatile functions, but we didn't
> have any consensus that the cure would be better than the disease.
> (In particular, since user-defined functions default to be
Fabien Fournier <[EMAIL PROTECTED]> writes:
> We are experiencing a strange error with the following request :
> select cmp
> from (select random () < 0.5 as cmp from pg_type) as tmp
> where cmp;
> With this request even false results are shown.
I think the planner will flatten this into
http://www.postgresql.org/docs/7.4/static/datatype-boolean.html
CASE WHEN its THEN 'true' ELSE 'false' END
-tfo
On Oct 14, 2004, at 3:43 PM, Bambero wrote:
Postgres returns me 't' or 'f' from boolean field
How to change that it returns me 'true' or 'false'
replace(its, 'f', 'false') AS its
doesn't
Pavel Stehule wrote:
create or replace function int2bool (integer) returns boolean as '
select case when $1=1 then ''t''::boolean else ''f''::boolean end;
' language sql;
I'd do it slightly differently, if only to cater to the principle of least surprise:
create or replace function int2bool (int
Dear Mage ,
I'm wondering why pgsql doesn't support boolean typecasts like select
true::int;
Many client applications including php assign 1 to true and 0 to false
This was a issue PHP < 4.2 + < PostgreSQL 7.3.x and supports it till
now for backward compatibility
--
Best Regards,
Vishal Kash
Pavel Stehule wrote:
Hello, you can use own cast.
I think I have to create an own type too, because I don't want to use
typecast in every select.
You gave me the idea, thank you.
Mage
---(end of broadcast)---
TIP 7: don't forget to i
Hello, you can use own cast.
create or replace function int2bool (integer) returns boolean as '
select case when $1=1 then ''t''::boolean else ''f''::boolean end;
' language sql;
create or replace function bool2int (boolean) returns integer as '
select case when $1 then 0 else 1 end; ' langua
On Sat, Jun 24, 2000 at 12:29:14PM -0400, Bruce Momjian wrote:
> [ Charset ISO-8859-1 unsupported, converting... ]
> > Thomas Lockhart writes:
> >
> > > Do you have a reference for an SQL99 document? Preferably on-line or in
> > > a form similar to what we've found for SQL3-1999?
> >
> > ftp://j
[ Charset ISO-8859-1 unsupported, converting... ]
> Thomas Lockhart writes:
>
> > Do you have a reference for an SQL99 document? Preferably on-line or in
> > a form similar to what we've found for SQL3-1999?
>
> ftp://jerry.ece.umassd.edu/isowg3/x3h2/Standards/ansi-iso-9075-[12345]-1999.txt
>
>
Thomas Lockhart writes:
> Do you have a reference for an SQL99 document? Preferably on-line or in
> a form similar to what we've found for SQL3-1999?
ftp://jerry.ece.umassd.edu/isowg3/x3h2/Standards/ansi-iso-9075-[12345]-1999.txt
This seems to be the real copyrighted deal, so get yours while it
Marc Britten writes:
> language-lawyer version.. you used the wrong version of the lang, the docs
> say it complies to SQL3, which has completely different wording than SQL99
SQL3 isn't a standard, the term used to be employed to mean "the potential
successor to ISO/IEC 9075:1992", which turned
29 matches
Mail list logo