[GENERAL] space taken by NULL values in array

2010-09-20 Thread Leonardo Francalanci
Hi, since postgresql multidimensional arrays can't have different size per axis, I was wondering what would happen in case I used an array of, say, 10x10 elements, where only 10x2 elements are filled and the rest are NULL. I guess the NULL elements take space (and I would have 80% of the space

Re: [GENERAL] Query plan choice issue

2010-09-20 Thread Yaroslav Tykhiy
On 14/09/2010, at 10:37 AM, Yaroslav Tykhiy wrote: On 14/09/2010, at 12:41 AM, Tom Lane wrote: Yaroslav Tykhiy y...@barnet.com.au writes: [...] I think the major problem you're having is that the planner is completely clueless about the selectivity of the condition

Re: [GENERAL] space taken by NULL values in array

2010-09-20 Thread John R Pierce
On 09/20/10 12:58 AM, Leonardo Francalanci wrote: Hi, since postgresql multidimensional arrays can't have different size per axis,... huh? says what? i thought PG multidimensional arrays were just arrays of arrays, and any dimension could be anything. in fact, the docs for 8.4 state

Re: [GENERAL] space taken by NULL values in array

2010-09-20 Thread Leonardo Francalanci
i thought PG multidimensional arrays were just arrays of arrays, and any dimension could be anything. from: http://www.postgresql.org/docs/8.4/static/arrays.html Multidimensional arrays must have matching extents for each dimension. A mismatch causes an error -- Sent via

Re: [GENERAL] space taken by NULL values in array

2010-09-20 Thread John R Pierce
On 09/20/10 1:24 AM, Leonardo Francalanci wrote: i thought PG multidimensional arrays were just arrays of arrays, and any dimension could be anything. from: http://www.postgresql.org/docs/8.4/static/arrays.html Multidimensional arrays must have matching extents for each dimension. A

Re: [GENERAL] how to insert multiple rows and get the ids back in a temp table (pgplsql)?

2010-09-20 Thread hubert depesz lubaczewski
On Sun, Sep 19, 2010 at 05:34:54PM -0700, Bret Green wrote: Thanks Any solution without cursors perhaps? write sql function as a wrapper around insert, and use it as a source for 2nd insert. depesz -- Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/ jid/gtalk:

[GENERAL] Data directory permissions.

2010-09-20 Thread Dmitriy Igrishin
Hey all, There are an output of postgres in a start time: FATAL: data directory /path/to/cluster has group or world access DETAIL: Permissions should be u=rwx (0700). Is there way to allow postgres starts with 0770 ? Regards, Dmitriy

[GENERAL] Data directory permissions.

2010-09-20 Thread Dmitriy Igrishin
Hey all, There are an output of postgres process in a start time: FATAL: data directory /path/to/cluster has group or world access DETAIL: Permissions should be u=rwx (0700). Is there way to allow postgres starts with 0770 ? Regards, Dmitriy

Re: [GENERAL] space taken by NULL values in array

2010-09-20 Thread Merlin Moncure
On Mon, Sep 20, 2010 at 4:12 AM, John R Pierce pie...@hogranch.com wrote:  On 09/20/10 12:58 AM, Leonardo Francalanci wrote: Hi, since postgresql multidimensional arrays can't have different size per axis,... huh?  says what? i thought PG multidimensional arrays were just arrays of

[GENERAL] pg_relation_size / could not open relation with OID #

2010-09-20 Thread tv
Hi everyone, I've run into a strange problem with system catalogs - we're collecting database stats periodically (every 10 minutes), and from time to time we get the following error: -- ERROR: could not open relation with OID 154873708

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Merlin Moncure
On Fri, Sep 17, 2010 at 3:59 PM, Sam Mason s...@samason.me.uk wrote: On Fri, Sep 17, 2010 at 04:51:46PM +0200, Willy-Bas Loos wrote: i have a function that produces a result in xml. that is one row, one value even, but it grows pretty large. how is that handled? Rows are sent back in the

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Sandeep Srinivasa
On Mon, Sep 20, 2010 at 5:27 PM, Merlin Moncure mmonc...@gmail.com wrote: On Fri, Sep 17, 2010 at 3:59 PM, Sam Mason s...@samason.me.uk wrote: On Fri, Sep 17, 2010 at 04:51:46PM +0200, Willy-Bas Loos wrote: i have a function that produces a result in xml. that is one row, one value even,

[GENERAL] unexpected EOF on client connection

2010-09-20 Thread Eric Ndengang
Hello everybody, Our Company get two Cluster environment with postgres 8.4.4 installed. Both Clusters have the same Structure (Tables, Functions, ...) In one of them I am recently getting many entries in the log on this type: 2010-09-20 14:21:25 CEST [31010]: [1-1] user=edarling,db=edarlingdb

Re: [GENERAL] unexpected EOF on client connection

2010-09-20 Thread Vick Khera
On Mon, Sep 20, 2010 at 8:31 AM, Eric Ndengang eric.ndengang_fo...@affinitas.de wrote: 2010-09-20 14:21:51 CEST [31492]: [1-1] user=edarling,db=edarlingdb LOG: unexpected EOF on client connection What really strange is, is that every  Application get connected through the Database using the

Re: [GENERAL] Getting FATAL: terminating connection due to administrator command

2010-09-20 Thread Adrien Kunysz
Is there any other way [than SystemTap] I can attack this issue [figuring out who sent a SIGTERM]? Attach GDB? gdb won't tell you who sent the signal. I don't really see any specific reason why sigmon.stp wouldn't show a SIGTERM if one was sent. An alternative could be to use auditd with

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Willy-Bas Loos
Rows are sent back in the entireity, so the PG instance would need enough memory to work with that row.  When you're running a 32bit version of PG, values whose size is beyond ~100MB are a bit touch and go whether it will work. ?? I hear that it's posible to store up to a GiB as a value for a

Re: [GENERAL] pg_relation_size / could not open relation with OID #

2010-09-20 Thread Tom Lane
t...@fuzzy.cz writes: I've run into a strange problem with system catalogs - we're collecting database stats periodically (every 10 minutes), and from time to time we get the following error: -- ERROR: could not open relation with OID

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Tom Lane
Willy-Bas Loos willy...@gmail.com writes: Rows are sent back in the entireity, so the PG instance would need enough memory to work with that row.  When you're running a 32bit version of PG, values whose size is beyond ~100MB are a bit touch and go whether it will work. ?? I hear that it's

[GENERAL] A note on pg_upgrade and missing pg_upgrade_support.so

2010-09-20 Thread Ian Barwick
Hi Just a quick note for anyone else building 9.0 from source and experimenting with pg_upgrade - if you get a message like the following when running the pg_upgrade binary: pg_upgrade_support.so must be created and installed in /path/to/pg90/lib/postgresql/pg_upgrade_support.so you need to

[GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Carlos Mennens
I have a table in my database and would like to modify the one column that is already configured to be the PRIMARY KEY but I forgot to set it for AUTO_INCREMENT. For some reason I can't find what the proper command would be in the documentation and my commands from MySQL don't appear to work

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Willy-Bas Loos
Rows are sent back in the entireity, so the PG instance would need enough memory to work with that row.  When you're running a 32bit version of PG, values whose size is beyond ~100MB are a bit touch and go whether it will work. ?? I hear that it's posible to store up to a GiB as a value for

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Thom Brown
On 20 September 2010 14:53, Carlos Mennens carlos.menn...@gmail.com wrote: I have a table in my database and would like to modify the one column that is already configured to be the PRIMARY KEY but I forgot to set it for AUTO_INCREMENT. For some reason I can't find what the proper command

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Karsten Hilbert
On Mon, Sep 20, 2010 at 03:37:58PM +0200, Willy-Bas Loos wrote: Rows are sent back in the entireity, so the PG instance would need enough memory to work with that row.  When you're running a 32bit version of PG, values whose size is beyond ~100MB are a bit touch and go whether it will

[GENERAL] to_date conversion semantics?

2010-09-20 Thread Colin 't Hart
Hi, I can't find in the Postgresql documentation the semantics that explains the following: co...@ruby:~/workspace/eyedb$ psql psql (8.4.4) Type help for help. colin= select to_date('731332', 'YYMMDD'); to_date 1974-02-01 (1 row) colin= Thanks, Colin

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Adrian Klaver
On Monday 20 September 2010 7:20:29 am Colin 't Hart wrote: Hi, I can't find in the Postgresql documentation the semantics that explains the following: co...@ruby:~/workspace/eyedb$ psql psql (8.4.4) Type help for help. colin= select to_date('731332', 'YYMMDD'); to_date

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Colin 't Hart
I must be blind, I can see the syntax but I can't see where it explains the wrapping phenomenon that I'm seeing. Cheers, Colin On 20 September 2010 16:36, Adrian Klaver adrian.kla...@gmail.com wrote: On Monday 20 September 2010 7:20:29 am Colin 't Hart wrote: Hi, I can't find in the

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Scott Ribe
On Sep 20, 2010, at 8:06 AM, Willy-Bas Loos wrote: Sheesh.. - why? Because you start with 4GB of address space, immediately give up maybe 0.5GB for mapping executable code (all the system libraries that get linked), plus a good chunk for the main thread stack, plus library data structures.

[GENERAL] Binary Replication and Slony

2010-09-20 Thread John Cheng
Congrats on the 9.0 release of PostgreSQL. One of the features I am really interested in is the built-in binary replication. Our production environment has been using PostgreSQL for more than 5 years (since this project started). We have been using Slony-I as our replication mechanism. I am

Re: [GENERAL] Data directory permissions.

2010-09-20 Thread Bruce Momjian
Dmitriy Igrishin wrote: Hey all, There are an output of postgres process in a start time: FATAL: data directory /path/to/cluster has group or world access DETAIL: Permissions should be u=rwx (0700). Is there way to allow postgres starts with 0770 ? You have to modify the source code

Re: [GENERAL] Binary Replication and Slony

2010-09-20 Thread Bruce Momjian
John Cheng wrote: Congrats on the 9.0 release of PostgreSQL. One of the features I am really interested in is the built-in binary replication. Our production environment has been using PostgreSQL for more than 5 years (since this project started). We have been using Slony-I as our

Re: [GENERAL] Data directory permissions.

2010-09-20 Thread Dmitriy Igrishin
Thanks Bruce! Regards, Dmitriy

[GENERAL] Bit-wise foreign keys

2010-09-20 Thread Alban Hertroys
Hey all, I'm tossing an idea around again, namely using bit positions and values as foreign key references. Let's start with a bit of background information: I'm currently parsing a log-file that I want to apply all kinds of statistical analysis to. This file contains lines of records of data,

Re: [GENERAL] Binary Replication and Slony

2010-09-20 Thread Chris Browne
johnlich...@gmail.com (John Cheng) writes: Congrats on the 9.0 release of PostgreSQL. One of the features I am really interested in is the built-in binary replication. Our production environment has been using PostgreSQL for more than 5 years (since this project started). We have been using

Re: [GENERAL] Binary Replication and Slony

2010-09-20 Thread Brad Nicholson
On 10-09-20 12:49 PM, Bruce Momjian wrote: John Cheng wrote: Congrats on the 9.0 release of PostgreSQL. One of the features I am really interested in is the built-in binary replication. Our production environment has been using PostgreSQL for more than 5 years (since this project started). We

Re: [GENERAL] Bit-wise foreign keys

2010-09-20 Thread Steve Atkins
On Sep 20, 2010, at 10:06 AM, Alban Hertroys wrote: Hey all, I'm tossing an idea around again, namely using bit positions and values as foreign key references. Let's start with a bit of background information: I'm currently parsing a log-file that I want to apply all kinds of

[GENERAL] Installing Contrib Modules with a Precompiled Binary

2010-09-20 Thread Aram Fingal
I'm using the OS X precompiled binary from EnterpriseDB and want to add the tablefunc contrib module. I haven't been able to find any documentation about how to do this or even whether modules can be added to this binary version. I suppose that it may be a good idea to export my databases

Re: [GENERAL] Installing Contrib Modules with a Precompiled Binary

2010-09-20 Thread Tom Lane
Aram Fingal fin...@multifactorial.com writes: I'm using the OS X precompiled binary from EnterpriseDB and want to add the tablefunc contrib module. I haven't been able to find any documentation about how to do this or even whether modules can be added to this binary version. Most

Re: [GENERAL] Installing Contrib Modules with a Precompiled Binary

2010-09-20 Thread Dave Page
On Mon, Sep 20, 2010 at 7:06 PM, Aram Fingal fin...@multifactorial.com wrote: I'm using the OS X precompiled binary from EnterpriseDB and want to add the tablefunc contrib module.  I haven't been able to find any documentation about how to do this or even whether modules can be added to this

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Carlos Mennens
On Mon, Sep 20, 2010 at 10:08 AM, Thom Brown t...@linux.com wrote: CREATE SEQUENCE seq_blades_id; SELECT setval('seq_blades_id', max(id)) FROM blades; -- set the sequence's value to the maximum value of id ALTER TABLE blades ALTER COLUMN id SET DEFAULT nextval('seq_blades_id'); -- make

Re: [GENERAL] A note on pg_upgrade and missing pg_upgrade_support.so

2010-09-20 Thread Bruce Momjian
Ian Barwick wrote: Hi Just a quick note for anyone else building 9.0 from source and experimenting with pg_upgrade - if you get a message like the following when running the pg_upgrade binary: pg_upgrade_support.so must be created and installed in

Re: [GENERAL] A note on pg_upgrade and missing pg_upgrade_support.so

2010-09-20 Thread Bruce Momjian
Bruce Momjian wrote: Ian Barwick wrote: Hi Just a quick note for anyone else building 9.0 from source and experimenting with pg_upgrade - if you get a message like the following when running the pg_upgrade binary: pg_upgrade_support.so must be created and installed in

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Carlos Mennens
On Mon, Sep 20, 2010 at 2:43 PM, A.M. age...@themactionfaction.com wrote: DEFAULT Sorry just to be clear you're saying that I need to enter the command as: INSERT INTO table_name DEFAULT VALUES ( 'data', 'data', 'data', 'data', '2010-09-20' ); Or does the 'DEFAULT' value go in ( )? -- Sent

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Thom Brown
On 20 September 2010 19:40, Carlos Mennens carlos.menn...@gmail.com wrote: On Mon, Sep 20, 2010 at 10:08 AM, Thom Brown t...@linux.com wrote: CREATE SEQUENCE seq_blades_id; SELECT setval('seq_blades_id', max(id)) FROM blades; -- set the sequence's value to the maximum value of id ALTER TABLE

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Adrian Klaver
On 09/20/2010 11:40 AM, Carlos Mennens wrote: On Mon, Sep 20, 2010 at 10:08 AM, Thom Brownt...@linux.com wrote: CREATE SEQUENCE seq_blades_id; SELECT setval('seq_blades_id', max(id)) FROM blades; -- set the sequence's value to the maximum value of id ALTER TABLE blades ALTER COLUMN id SET

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Thom Brown
On 20 September 2010 19:54, Carlos Mennens carlos.menn...@gmail.com wrote: On Mon, Sep 20, 2010 at 2:43 PM, A.M. age...@themactionfaction.com wrote: DEFAULT Sorry just to be clear you're saying that I need to enter the command as: INSERT INTO table_name DEFAULT VALUES ( 'data', 'data',

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Adrian Klaver
On 09/20/2010 07:50 AM, Colin 't Hart wrote: I must be blind, I can see the syntax but I can't see where it explains the wrapping phenomenon that I'm seeing. Cheers, Colin My turn to be blind, what wrapping ? :) -- Adrian Klaver adrian.kla...@gmail.com -- Sent via pgsql-general mailing

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Carlos Mennens
Thanks all! I understand the concept now. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Colin 't Hart
The 32nd of Undecember (!) turning into the 1st of February of the next year... instead of throwing an exception like I expect. On 20 September 2010 21:02, Adrian Klaver adrian.kla...@gmail.com wrote: On 09/20/2010 07:50 AM, Colin 't Hart wrote: I must be blind, I can see the syntax but I

[GENERAL] INSERT with SELECT not working in pgAdmin

2010-09-20 Thread Stefan Wild
Hi guys, I'm trying to merge two tables to one with INSERT and SELECT commands: INSERT into c_transactions (timestamp) SELECT entrytimestamp from c_transactions INSERT into c_transactions (timestamp) SELECT exittimestamp from c_transactions But getting this error on execution (in pgAdmin):

Re: [GENERAL] Installing Contrib Modules with a Precompiled Binary

2010-09-20 Thread Aram Fingal
On Sep 20, 2010, at 2:12 PM, Dave Page wrote: On Mon, Sep 20, 2010 at 7:06 PM, Aram Fingal fin...@multifactorial.com wrote: I'm using the OS X precompiled binary from EnterpriseDB and want to add the tablefunc contrib module. I haven't been able to find any documentation about how to do

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Tom Lane
Colin 't Hart colinth...@gmail.com writes: The 32nd of Undecember (!) turning into the 1st of February of the next year... instead of throwing an exception like I expect. As mentioned previously, to_date isn't the tool to use if you want a strict conversion --- it's designed to be rather, um,

Re: [GENERAL] to_date conversion semantics?

2010-09-20 Thread Richard Huxton
On 20/09/10 20:18, Colin 't Hart wrote: The 32nd of Undecember (!) turning into the 1st of February of the next year... instead of throwing an exception like I expect. What Tom said, but it's presumably using mktime(...) somewhere internally. perl -MPOSIX -e 'print scalar

Re: [GENERAL] INSERT with SELECT not working in pgAdmin

2010-09-20 Thread Dmitriy Igrishin
Hey Stefan, The sounds like you have a field id in you c_transactions without default value (which usually should be nextval('some_sequence'::regclass). Do you create a sequence for c_transactions.id ? -- Regards, Dmitriy

Re: [GENERAL] Installing Contrib Modules with a Precompiled Binary

2010-09-20 Thread Dave Page
On Mon, Sep 20, 2010 at 8:20 PM, Aram Fingal fin...@multifactorial.com wrote: So that means something like: psql -d dbname -f /Library/PostgreSQL/8.4/share/postgresql/contrib/tablefunc.sql Yup. I suppose that I will have to export and re-import the databases when I upgrade? Hmm, yes -

Re: [GENERAL] pgpool-II 3.0 + postgres 9rc1 + md5 authentication not working

2010-09-20 Thread Bryan Murphy
On Sun, Sep 19, 2010 at 11:31 PM, Tatsuo Ishii is...@sraoss.co.jp wrote: Sorry for delay. I had a trip outside Japan. No problem. I found nasty bug with pgpool. Please try attached patches. I tried the patch file and I still cannot connect. The only other difference is that I've already

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Merlin Moncure
On Mon, Sep 20, 2010 at 10:08 AM, Thom Brown t...@linux.com wrote: On 20 September 2010 14:53, Carlos Mennens carlos.menn...@gmail.com wrote: I have a table in my database and would like to modify the one column that is already configured to be the PRIMARY KEY but I forgot to set it for

Re: [GENERAL] Alter Table Auto_Increment

2010-09-20 Thread Thom Brown
On 20 September 2010 20:58, Merlin Moncure mmonc...@gmail.com wrote: On Mon, Sep 20, 2010 at 10:08 AM, Thom Brown t...@linux.com wrote: On 20 September 2010 14:53, Carlos Mennens carlos.menn...@gmail.com wrote: I have a table in my database and would like to modify the one column that is

Re: [GENERAL] Data directory permissions.

2010-09-20 Thread Dmitriy Igrishin
Thanks, Bruce! 2010/9/20 Bruce Momjian br...@momjian.us Dmitriy Igrishin wrote: Hey all, There are an output of postgres process in a start time: FATAL: data directory /path/to/cluster has group or world access DETAIL: Permissions should be u=rwx (0700). Is there way to allow

Re: [GENERAL] pg_relation_size / could not open relation with OID #

2010-09-20 Thread Tomas Vondra
Dne 20.9.2010 15:44, Tom Lane napsal(a): t...@fuzzy.cz writes: I've run into a strange problem with system catalogs - we're collecting database stats periodically (every 10 minutes), and from time to time we get the following error: -- ERROR:

Re: [GENERAL] pgpool-II 3.0 + postgres 9rc1 + md5 authentication not working

2010-09-20 Thread Tatsuo Ishii
I tried the patch file and I still cannot connect. The only other difference is that I've already upgraded our images to Postgres 9.0.0 from rc1. Here is the pgpool debug log: 2010-09-20 19:43:19 DEBUG: pid 1329: I am 1329 accept fd 6 2010-09-20 19:43:19 LOG: pid 1329: connection

Re: [GENERAL] pg_relation_size / could not open relation with OID #

2010-09-20 Thread Tom Lane
Tomas Vondra t...@fuzzy.cz writes: Dne 20.9.2010 15:44, Tom Lane napsal(a): I think you're probably hitting a problem with a table being deleted while you're scanning pg_class. pg_relation_size() will fail if the given OID isn't valid now --- but the underlying query returns all OIDs that

Re: [GENERAL] Binary Replication and Slony

2010-09-20 Thread John Cheng
Much thanks to everyone! The mailing list, as usual, has been extremely helpful. On Mon, Sep 20, 2010 at 10:33 AM, Brad Nicholson bnich...@ca.afilias.infowrote: On 10-09-20 12:49 PM, Bruce Momjian wrote: John Cheng wrote: Congrats on the 9.0 release of PostgreSQL. One of the features I am

Re: [GENERAL] where does postgres keep the query result until it is returned?

2010-09-20 Thread Craig Ringer
On 20/09/2010 10:56 PM, Scott Ribe wrote: - should this be documented? Doubtful. It has to do with very well known limits of 32-bit programs, applies to any use for a 1GB block regardless of where it comes from (network or disk), really has nothing to do with postgres, and the actual size