[GENERAL] Out of Memory Error on Insert

2011-10-17 Thread Mark Priest
I am getting an Out of Memory error in my server connection process while running a large insert query. Postgres version: "PostgreSQL 8.2.16 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)" OS: Windows 7 Professional (v.6.1, build 7601 service pack 1) The OS is 64 bit but t

[GENERAL] Plans to fix table inheritance caveats

2011-10-17 Thread Evan Martin
Hi, Are there any plans to fix the caveats documented in section 5.8.1, particularly allowing rows in a derived table to satisfy a foreign key defined on a base table? I know it's on the TODO list ( http://wiki.postgresql.org/wiki/Todo#Inheritance ) - just wondering if anyone is actually work

Re: [GENERAL] Video of Activity on PostgreSQL GIT repository

2011-10-17 Thread Martijn van Oosterhout
On Thu, Oct 13, 2011 at 11:55:47AM -0300, Fabrízio de Royes Mello wrote: > Hi all, > > I like to share this cool video which I build [1] (using gource [2]) to show > the activity of PostgreSQL GIT repository in the few months ago. That's pretty cool. I'm always astonished at the code turnover rat

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David Salisbury Sent: Monday, October 17, 2011 3:41 PM To: John R Pierce Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] exclusive OR possible within a where clause?

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread David Salisbury
On 10/17/11 2:12 PM, John R Pierce wrote: On 10/17/11 12:40 PM, David Salisbury wrote: something --- 1 2 select * from test where ( something = 1.5 + .5 ) .XOR. ( something = 1.5 - .5 ); well, something[1] = 1, so thats FALSE .XOR. TRUE, which is TRUE and, something[2] = 2, so that

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread John R Pierce
On 10/17/11 12:40 PM, David Salisbury wrote: something --- 1 2 select * from test where ( something = 1.5 + .5 ) .XOR. ( something = 1.5 - .5 ); well, something[1] = 1, so thats FALSE .XOR. TRUE, which is TRUE and, something[2] = 2, so thats TRUE .XOR. FALSE, whi

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread David Salisbury
On 10/17/11 1:19 PM, John R Pierce wrote: On 10/17/11 12:15 PM, David Salisbury wrote: <> is the same as !=, which is different than the fabled XOR I was hoping for. In fact they would never equal. F != F -> false F != T -> true T != F -> true T != T -> false how is that different than XOR

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread Ken Tanzer
If you don't care about which row you get, how about adding a "LIMIT 1" to your query? Don't know if that counts as "messy" or not... :) On Mon, Oct 17, 2011 at 12:15 PM, David Salisbury wrote: > > > On 10/14/11 10:58 AM, David Fetter wrote: > >> On Thu, Oct 13, 2011 at 07:49:59PM -0400, Tom Lan

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread John R Pierce
On 10/17/11 12:15 PM, David Salisbury wrote: <> is the same as !=, which is different than the fabled XOR I was hoping for. In fact they would never equal. F != F -> false F != T -> true T != F -> true T != T -> false how is that different than XOR, assuming the arguments are booleans ? -

Re: [GENERAL] exclusive OR possible within a where clause?

2011-10-17 Thread David Salisbury
On 10/14/11 10:58 AM, David Fetter wrote: On Thu, Oct 13, 2011 at 07:49:59PM -0400, Tom Lane wrote: David Salisbury writes: Short version, is there a way to implement an exclusive OR in a where clause? The boolean<> operator will do the trick. (x = y)<> (a = b)

Re: [GENERAL] Use true and false when bulk-exporting boolean data

2011-10-17 Thread Henry Drexler
On Mon, Oct 17, 2011 at 3:11 PM, Henry Drexler wrote: > couldn't you just wrap it in a case statement to change the t to true > etc...? > > example: select case when (1=1) = true then 'true' else 'false' end

Re: [GENERAL] Use true and false when bulk-exporting boolean data

2011-10-17 Thread Henry Drexler
couldn't you just wrap it in a case statement to change the t to true etc...? On Mon, Oct 17, 2011 at 2:29 PM, Viktor Rosenfeld wrote: > Hi, > > I need to move data from PostgreSQL to MonetDB and also bulk-import data > into MonetDB that was bulk-exported from PostgreSQL by other people. My > pr

Re: [GENERAL] 9.1 got really fast ;)

2011-10-17 Thread Scott Marlowe
On Mon, Oct 17, 2011 at 9:44 AM, Tom Lane wrote: > Alban Hertroys writes: >> On 17 October 2011 17:25, Steve Crawford >> wrote: >>> Even stand-alone statements take place within a transaction - just not an >>> explicit one. > >> I doubt that more than 2.368 ms passed between the start of a >> t

[GENERAL] Use true and false when bulk-exporting boolean data

2011-10-17 Thread Viktor Rosenfeld
Hi, I need to move data from PostgreSQL to MonetDB and also bulk-import data into MonetDB that was bulk-exported from PostgreSQL by other people. My problem is that boolean data is exported by PostgreSQL using the values "t" and "f" (unquoted) and that MonetDB expects "true" and "false". Is there

Re: [GENERAL] Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()

2011-10-17 Thread David McKeone
On 2011-10-17, at 4:23 PM, Tom Lane wrote: > > Hm, is there a libpq dylib in /usr/lib? If so, maybe it's capturing the > reference? "otool -L main" would be informative about which dylib is > actually getting called, I think. If it's not what you expected, the > lack of a -L switch in your link

Re: [GENERAL] 9.1 got really fast ;)

2011-10-17 Thread Lincoln Yeoh
At 11:44 PM 10/17/2011, Tom Lane wrote: Alban Hertroys writes: > On 17 October 2011 17:25, Steve Crawford wrote: >> Even stand-alone statements take place within a transaction - just not an >> explicit one. > I doubt that more than 2.368 ms passed between the start of a > transaction and the

Re: [GENERAL] index bloat question

2011-10-17 Thread Szymon Guz
On 17 October 2011 15:42, Merlin Moncure wrote: > On Mon, Oct 17, 2011 at 2:15 AM, Szymon Guz wrote: > > > > > > On 17 October 2011 02:01, Scott Marlowe wrote: > >> > >> On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz wrote: > >> > Hi, > >> > just a couple of questions: > >> > will there be an ind

Re: [GENERAL] 9.1 got really fast ;)

2011-10-17 Thread Tom Lane
Alban Hertroys writes: > On 17 October 2011 17:25, Steve Crawford > wrote: >> Even stand-alone statements take place within a transaction - just not an >> explicit one. > I doubt that more than 2.368 ms passed between the start of a > transaction and the stand-alone statement it's wrapping thou

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 10:28 AM, Alban Hertroys wrote: > On 17 October 2011 16:24, Merlin Moncure wrote: >> On Mon, Oct 17, 2011 at 8:44 AM, Alban Hertroys wrote: >>> On 17 October 2011 15:20, Merlin Moncure wrote: A better way to do this is to query information_schema: PERFORM

Re: [GENERAL] 9.1 got really fast ;)

2011-10-17 Thread Alban Hertroys
On 17 October 2011 17:25, Steve Crawford wrote: > On 10/16/2011 04:39 PM, Scott Marlowe wrote: >> >> On Sun, Oct 16, 2011 at 5:24 PM, Tom Lane  wrote: >>> >>> Scott Marlowe  writes: On Sat, Oct 15, 2011 at 2:20 PM, Thomas Kellerer  wrote: > > Total runtime: -2.368 ms<< t

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Alban Hertroys
On 17 October 2011 16:24, Merlin Moncure wrote: > On Mon, Oct 17, 2011 at 8:44 AM, Alban Hertroys wrote: >> On 17 October 2011 15:20, Merlin Moncure wrote: >>> A better way to do this is to query information_schema: >>> >>> PERFORM 1 FROM information_schema.tables where schema_name = x and >>> t

Re: [GENERAL] [ADMIN] Trying to use binary replication - from tutorial

2011-10-17 Thread Evan Walter
Yes thank you. I actually did get it working eventually, with the things you mentioned. Also, the recovery.conf has to be in the directory that contains the data folder! I previously had it in the folder with the config files, which in my installation are different. Once I moved the recovery.conf

Re: [GENERAL] 9.1 got really fast ;)

2011-10-17 Thread Steve Crawford
On 10/16/2011 04:39 PM, Scott Marlowe wrote: On Sun, Oct 16, 2011 at 5:24 PM, Tom Lane wrote: Scott Marlowe writes: On Sat, Oct 15, 2011 at 2:20 PM, Thomas Kellerer wrote: Total runtime: -2.368 ms<< this is amazing ;) I get something similar when I do select now()-query_start from pg_s

Re: [GENERAL] Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()

2011-10-17 Thread Tom Lane
David McKeone writes: > I've been getting acquainted with the C interface for libpq and have run into > an issue with trying to link to the dynamic libpq while still getting thread > safety. I have tried the following by compiling the 9.1 source with the > --enable-thread-safety flag and I've

Re: [GENERAL] [ADMIN] Trying to use binary replication - from tutorial

2011-10-17 Thread Mark Keisler
In your recovery.conf, you should also have a restore_command setting. That's what the standby postgres will use to grab the archived WAL logs from the master and it needs to. So yes, you need archive set to on and an archive_command command setting on the master. You at least need that for catch

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 8:44 AM, Alban Hertroys wrote: > On 17 October 2011 15:20, Merlin Moncure wrote: >> A better way to do this is to query information_schema: >> >> PERFORM 1 FROM information_schema.tables where schema_name = x and >> table_name = y; >> >> IF FOUND THEN >>  CREATE TABLE ...

[GENERAL] Mac OS X 10.6 - libpq.dylib vs. libpq.a and PQisthreadsafe()

2011-10-17 Thread David McKeone
Hello, I've been getting acquainted with the C interface for libpq and have run into an issue with trying to link to the dynamic libpq while still getting thread safety. I have tried the following by compiling the 9.1 source with the --enable-thread-safety flag and I've tried the libpq librari

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Alban Hertroys
On 17 October 2011 15:20, Merlin Moncure wrote: > A better way to do this is to query information_schema: > > PERFORM 1 FROM information_schema.tables where schema_name = x and > table_name = y; > > IF FOUND THEN >  CREATE TABLE ... > END IF; > > (there is a race condition in the above code -- do

Re: [GENERAL] index bloat question

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 2:15 AM, Szymon Guz wrote: > > > On 17 October 2011 02:01, Scott Marlowe wrote: >> >> On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz wrote: >> > Hi, >> > just a couple of questions: >> > will there be an index bloat if I have: >> > - a serial column and only add rows to the

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 8:20 AM, Merlin Moncure wrote: > On Mon, Oct 17, 2011 at 2:32 AM,   wrote: >> Hi there, >> >> I would like to use EXISTS in a small plpgsql function but I always >> get a "syntax error". How can I execute a query inside the >> EXISTS function? >> >> >> >> IF NOT EXISTS(EXEC

Re: [GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread Merlin Moncure
On Mon, Oct 17, 2011 at 2:32 AM, wrote: > Hi there, > > I would like to use EXISTS in a small plpgsql function but I always > get a "syntax error". How can I execute a query inside the > EXISTS function? > > > > IF NOT EXISTS(EXECUTE 'SELECT * FROM '|| tmp_tbl) >   THEN >      CREATE TABLE tt();

Re: [GENERAL] Using constraint exclusion with 2 floats

2011-10-17 Thread Simon Riggs
On Wed, Oct 12, 2011 at 10:40 PM, Julien Rouhaud wrote: > Thank you for your answer. > > I'm sorry I really didn't explained well my problem :/ > > For example if I have a table test like this : > CREATE TABLE test (min real not null, max real not null, desc character > varying not null); > > and

[GENERAL] plpgsql; execute query inside exists

2011-10-17 Thread jozsef . kurucz
Hi there, I would like to use EXISTS in a small plpgsql function but I always get a "syntax error". How can I execute a query inside the EXISTS function? IF NOT EXISTS(EXECUTE 'SELECT * FROM '|| tmp_tbl) THEN CREATE TABLE tt(); ERROR: syntax error at or near "EXECUTE" LINE 1: SELE

Re: [GENERAL] index bloat question

2011-10-17 Thread Szymon Guz
On 17 October 2011 02:01, Scott Marlowe wrote: > On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz wrote: > > Hi, > > just a couple of questions: > > will there be an index bloat if I have: > > - a serial column and only add rows to the table? > > - a text column and I only add rows to the table? > >