Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Andrey G.
It seems my original test, which also includes the EXECUTE approach, has not come to you in full. EXECUTE statement also fails with parameter: The test is attached in file. psql -q < db/db/pgbug_5776.sql ERROR:  there is no parameter $1 LINE 1: CREATE VIEW v4 AS SELECT * FROM t1 WHERE some_field =

[BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Ng, Stan
I've noticed what appears to be index corruption on composite primary key indexes during my testing. Data deletes, updates, and inserts are applied from delta data that is loaded into temporary tables. The duplicate key error occurs at different points in time and isn't isolated to any single table

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Pavel Stehule
Hello View must not has a parameter in PostgreSQL. You can use a SRF function: postgres=# create or replace function parametrized_view(a int) returns setof foo as $$ select * from foo where a = $1; $$ language sql immutable; CREATE FUNCTION

Re: [BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Mikael Krantz
This could quite possibly be a correct behaviour. "duplicate key value violates unique constraint" usually happens when you try to insert a row to a table already containing a row with the same value(s) for the key column(s). If you have two connections both trying to insert a new record with the s

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Pavel Stehule
Hello 2010/12/14 Andrey G. : > Pavel, > > As far as I'm aware, SETOF return creates whole result in memory, what > has some implications. > it's not true for immutable SQL function - look on EXPLAIN > My intention was to create a temporary view in session, which can be > used in other processing

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Andrey G.
Pavel, As far as I'm aware, SETOF return creates whole result in memory, what has some implications. My intention was to create a temporary view in session, which can be used in other processing. Of course, I've found another solution, but creating view with parameter dynamically could be a good

Re: [BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Craig Ringer
On 12/14/2010 10:18 AM, Ng, Stan wrote: Some info on the platform I’m using: Please also show your schema and query / queries. If you think it's corruption, provide your postgresql logs too, including any mention of the names of the suspect indexes. Personally I agree with Mikael Krantz; y

[BUGS] [Fwd: DBD::Pg on HP-UX 11.31 64bit]

2010-12-14 Thread Simon Riggs
FW Forwarded Message From: H.Merijn Brand To: DBI Developers Mailing List , Simon Riggs Subject: DBD::Pg on HP-UX 11.31 64bit Date: Tue, 14 Dec 2010 13:35:49 +0100 I have postgres running on most my HP-UX varieties, ranging from HP-UX 10.20/32bit through 11.31/64bit. It works

Re: [BUGS] [Fwd: DBD::Pg on HP-UX 11.31 64bit]

2010-12-14 Thread Tom Lane
Simon Riggs writes: > FW > From: H.Merijn Brand > I have postgres running on most my HP-UX varieties, ranging from HP-UX > 10.20/32bit through 11.31/64bit. It works fine everywhere, except on > HP-UX 11.31-ipf in 64bit mode. Note that this is Itanium architecture. > postgres' own test suite pass

Re: [BUGS] Problems with max_connections parameter

2010-12-14 Thread Robert Haas
On Mon, Dec 13, 2010 at 8:46 PM, Jorge Augusto Meira wrote: > Have something else I can do to reach the limit of the parameter > max_connections? > > This may be a bug? Well, I don't think you've really identified what's happening. Kevin and Tom both suggested possible explanations upthread. --

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Robert Haas
On Mon, Dec 13, 2010 at 4:28 PM, Andrey G. wrote: > It seems my original test, which also includes the EXECUTE approach, > has not come to you in full. EXECUTE statement also fails with > parameter: The test is attached in file. > > psql -q < db/db/pgbug_5776.sql > ERROR:  there is no parameter $1

Re: [BUGS] BUG #5779: Large INSERT transaction with FOREIGN KEY constraints exhausts available RAM

2010-12-14 Thread Robert Haas
On Wed, Dec 1, 2010 at 3:09 AM, Michel Alexandre Salim wrote: > I tried changing the fkey constraints to DEFERRABLE hoping that that would > consume less RAM, but the same result occurs. Why should the memory usage > pattern be different when integrity checks are done as part of the > transaction

Re: [BUGS] memory leak in xml2 contrib module

2010-12-14 Thread Robert Haas
On Fri, Nov 26, 2010 at 7:54 AM, wrote: > one of my colleagues found ugly memory leak in the xml2 contrib module. > Try this: > > select xpath_number('' || generate_series || '','/data') from > generate_series(1,50); > > This will allocate arbitrary amount of memory, and it won't release it >

Re: [BUGS] Privileges to start system services

2010-12-14 Thread Robert Haas
On Tue, Dec 7, 2010 at 5:09 AM, Abdellah Amrani wrote: > Sorry, my English is not good. > I am administrator of my computer > I download poker tracker 3 and I can not install PostgreSQL 8.3 > I have the error message : > Service 'PostgreSQL' Database Server 8.3 [pgsql-8.3] failed to start. Verify

Re: [BUGS] memory leak in xml2 contrib module

2010-12-14 Thread Tomas Vondra
Dne 14.12.2010 21:50, Robert Haas napsal(a): > On Fri, Nov 26, 2010 at 7:54 AM, wrote: >> one of my colleagues found ugly memory leak in the xml2 contrib module. >> Try this: >> >> select xpath_number('' || generate_series || '','/data') from >> generate_series(1,50); >> >> This will allocate

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Robert Haas
On Tue, Dec 14, 2010 at 4:03 PM, Andrey G. wrote: > Yes, you've read my mind about quote_literal() ;). The bug report is > rising exactly the parameter substitution issue. Yeah. I don't think it's exactly a bug so much as a known limitation, but of course I agree it would be convenient if it wor

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Andrey G.
OK. Thanks, Andrey. 2010/12/14 Pavel Stehule : > Hello > > 2010/12/14 Andrey G. : >> Pavel, >> >> As far as I'm aware, SETOF return creates whole result in memory, what >> has some implications. >> > > it's not true for immutable SQL function - look on EXPLAIN > >> My intention was to create a

Re: [BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Ng, Stan
Ah, I forgot to mention why I suspected corruption. The delta application is a single threaded, sequential process. Each delta is done within a single transaction. If it fails, there is retry logic that will continue to attempt the delta application forever, with about a 5 to 10 minute wait. This w

Re: [BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Ng, Stan
Just to follow up -- I did find the error in the pgsql logs after all, although it does not contain any additional information. i.e.: PSTERROR: duplicate key value violates unique constraint -Original Message- From: Ng, Stan Sent: Tuesday, December 14, 2010 10:42 AM To: 'Craig Ringer' Cc

Re: [BUGS] BUG #5776: Unable to create view with parameter in PL/pgsql

2010-12-14 Thread Andrey G.
Robert, Yes, you've read my mind about quote_literal() ;). The bug report is rising exactly the parameter substitution issue. Andrey 2010/12/14 Robert Haas : > On Mon, Dec 13, 2010 at 4:28 PM, Andrey G. wrote: >> It seems my original test, which also includes the EXECUTE approach, >> has not

Re: [BUGS] index corruption on composite primary key indexes

2010-12-14 Thread Mikael Krantz
I'm afraid that I'm a bit out of my depth when it comes to index corruption. I did note a possibly unrelated problem: The unique index includes the lower(postalcode::text) but your left join is made on VehicleUsedICCGRadiusCache.PostalCode = t1.PostalCode. It seems likely that you do this left joi