Re: [SQL] Best way to simulate Booleans

2009-07-07 Thread Scott Marlowe
On Mon, Jul 6, 2009 at 7:22 PM, Peter Headlandpheadl...@actuate.com wrote: I know, I know, PostgreSQL has Booleans that work very nicely. Unfortunately, I have to create a schema that will work on Oracle as well as PostgreSQL, by which I mean that a single set of Java/JDBC code has to work

Re: [SQL] Best way to simulate Booleans

2009-07-07 Thread Dirk Jagdmann
The most transportable method would be to use either a char(1) or an int with a check constraint. mybool char(1) check (mybool in ('t','f')) mybool int check (mybool =0 and =1) I would decide depending on the application requirement. If my Oracle should look similar to PostgreSQL use the

Re: [SQL] Best way to simulate Booleans

2009-07-07 Thread Simon Riggs
On Tue, 2009-07-07 at 00:13 -0600, Scott Marlowe wrote: On Mon, Jul 6, 2009 at 7:22 PM, Peter Headlandpheadl...@actuate.com wrote: I know, I know, PostgreSQL has Booleans that work very nicely. Unfortunately, I have to create a schema that will work on Oracle as well as PostgreSQL, by

Re: [SQL] Best way to simulate Booleans

2009-07-07 Thread Greg Stark
On Tue, Jul 7, 2009 at 10:17 AM, Simon Riggssi...@2ndquadrant.com wrote: Integer works best since it converts easily to boolean mybool smallint check (mybool in (0, 1)) You can use char also, but the syntax is less clear. Hm, I was going to suggest using boolean in postgres and making a

Re: [SQL] fsync and Windows XP

2009-07-07 Thread Jon Norman
I've tried the different wal_sync_method settings and nothing seems to work. I don't know if it matters, but I'm running PostgreSQL on an XP Embedded system. Initially, I had most of my tables installed in the default location, c:\program files\postgresql\8.3\data, on compact flash -- which is

[SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-07 Thread jacob
One of our programmers has come to me with a problem. On 3 new Centos 5.3 servers running Postgres 8.2.13 query's are taking 3500ms-5000ms to complete, where the same query on an older server (same hardware, older software revisions) the same query on the same data comes back in 50 ms. After

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-07 Thread Greg Stark
On Tue, Jul 7, 2009 at 11:33 PM, ja...@aers.ca wrote: After some investigation it seems that the new server is refusing to use the index's but if I limit the number of arguments in the latter part of the statement to 100 then it works as expected in the expected amount of time using the

Re: [SQL] FW: Query length limitation in postgres server 8.2.9

2009-07-07 Thread Tom Lane
Greg Stark gsst...@mit.edu writes: On Tue, Jul 7, 2009 at 11:33 PM, ja...@aers.ca wrote: After some investigation it seems that the new server is refusing to use the index's but if I limit the number of arguments in the latter part of the statement to 100 then it works as expected in the