Re: [SQL] date_trunc should be called date_round?

2009-06-30 Thread Mario Splivalo
Tom Lane wrote: Mario Splivalo mario.spliv...@megafon.hr writes: But, date_trunc behaves like round function: round(1.9) = 2. Hmm ... only for float timestamps, and only for the millisec/microsec cases. case DTK_MILLISEC: #ifdef HAVE_INT64_TIMESTAMP fsec =

[SQL] fsync and Windows XP

2009-06-30 Thread Jon Norman
What is the trick for getting the fsync feature to work with Windows XP. I've turned off disk caching and set fsync = on in my postgresql.conf, but records are still not immediately written to disk. Any help would be appreciated.

[SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Everybody, I have a table called gallo.sds_seq_reg_shw, which is like: canon=# \d gallo.sds_seq_reg_shw Table gallo.sds_seq_reg_shw Column | Type | Modifiers --+-+--- name | text| response | text|

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Rob Sargent
Tena Sakai wrote: Hi Everybody, I have a table called gallo.sds_seq_reg_shw, which is like: canon=# \d gallo.sds_seq_reg_shw Table gallo.sds_seq_reg_shw Column | Type | Modifiers --+-+--- name | text| response

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Edward W. Rouse
Just out of curiosity did you try maf = 0? Edward W. Rouse From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Tena Sakai Sent: Tuesday, June 30, 2009 6:03 PM To: pgsql-sql@postgresql.org Subject: [SQL] it's not NULL, then what is it? Hi Everybody,

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Steve Crawford
... canon=# select count(maf) from gallo.sds_seq_reg_shw canon-# where maf ISNULL; count --- 0 (1 row) I believe count will only count not-null anyway so this will always return zero. Try count(*) instead of count(maf). Here's an example: st...@[local]= select * from

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Thomas Kellerer
Steve Crawford wrote on 01.07.2009 00:39: canon=# select count(maf) from gallo.sds_seq_reg_shw canon-# where maf ISNULL; I believe count will only count not-null Correct SELECT count(some_col) FROM some_table; is the same as SELECT count(*) FROM some_table WHERE some_col IS NOT NULL;

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Rob, Maybe something like select ']' || maf::text || '[' -- just to see where the value start/stops It prints many (1,132,691 to be exact) lines consisting of 7 space characters followed by many lines like: ]0.0106383[ ]0.0106383[ ]0.0106383[ or select

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Edward, Just out of curiosity did you try maf = 0? Yes, and this is what I get: canon=# select maf canon-# from gallo.sds_seq_reg_shw canon-# where maf = 0; maf - (0 rows) Regards, Tena Sakai tsa...@gallo.ucsf.edu -Original Message- From:

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Steve, I believe count will only count not-null anyway so this will always return zero. Understood. But that doesn't help me... What I need is a query expression that I can substitute for isblabla below: select maf from gallo.sds_seq_reg_shw where maf isblabla; Regards, Tena

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Osvaldo, Try: SELECT count(*) FROM gallo.sds_seq_reg_shw; SELECT count(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NULL; SELECT count(*) FROM gallo.sds_seq_reg_shw WHERE maf IS NOT NULL; Don't use count(maf), use count(*). Indeed! canon=# SELECT count(*) FROM gallo.sds_seq_reg_shw;

Re: [SQL] it's not NULL, then what is it?

2009-06-30 Thread Tena Sakai
Hi Tom, What platform are you running on exactly? It is redhat linux running on Dell hardware. uname -a returns: Linux vixen.egcrc.org 2.6.9-78.0.1.ELsmp #1 SMP Tue Jul 22 18:01:05 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux And for that matter, what PG version is this? It is 8.3.6. Regards,