Re: [GENERAL] Bug? Query plans / EXPLAIN using gigabytes of memory

2012-04-26 Thread Toby Corkindale
On 26/04/12 16:58, Tom Lane wrote: Toby Corkindale writes: On 26/04/12 15:30, Tom Lane wrote: Hm, is the update target an inheritance tree? The target is the parent table of a bunch of partitions. How many would "a bunch" be, exactly? I'm fairly sure that the complex view would get re-pl

Re: [GENERAL] Bug? Query plans / EXPLAIN using gigabytes of memory

2012-04-26 Thread Toby Corkindale
On 26/04/12 17:16, Toby Corkindale wrote: On 26/04/12 16:58, Tom Lane wrote: Toby Corkindale writes: On 26/04/12 15:30, Tom Lane wrote: Hm, is the update target an inheritance tree? The target is the parent table of a bunch of partitions. How many would "a bunch" be, exactly? I'm fairly s

Re: [GENERAL] Bug? Query plans / EXPLAIN using gigabytes of memory

2012-04-26 Thread Toby Corkindale
On 26/04/12 13:11, Tom Lane wrote: Toby Corkindale writes: Just wondering if anyone else has thoughts on this? I'm still suspicious that this is a bug. Well, if you were to provide a reproducible test case, somebody might be motivated to look into it. There could be a memory leak in the p

Re: [GENERAL] Stange "duplicate key value violates unique constraint" after "delete" at ON UPDATE trigger

2012-04-26 Thread Dmitry Koterov
I'm not sure the cause is that DELETE does not see the row. Seems the following method solves the problem when 2 same-time transactions are active: CREATE FUNCTION a_tr() RETURNS trigger AS $body$ DECLARE tmp INTEGER; BEGIN -- Lock until the mathed entry (possibly phantom - i.e. not yet c

[GENERAL] R-tree parallel index creation

2012-04-26 Thread Pavel Iacovlev
Hello, Anyone know if this features is supported in PostgreSQL: "R-tree index creation can be subdivided into smaller tasks that can be performed in parallel" ? Best Regards, Iacovlev Pavel

[GENERAL] WARNING: worker took too long to start; cancelled

2012-04-26 Thread Tomohiro Nakata
Hi, Postgres9.0.5 is operated on Linux. Left the following logs and CPU shows 100%. WARNING: worker took too long to start; cancelled The error which is not connectable with a database had generated web application then. When DB server was rebooted, it came to operate correctly again. Although I

Re: [GENERAL] Stange "duplicate key value violates unique constraint" after "delete" at ON UPDATE trigger

2012-04-26 Thread Dmitry Koterov
I have had 2 hours of experiments and finally I suppose that there is no way to satisfy this unique constraint index from within a trigger with non-whole-table locking. So Julian seems to be right (unfortunately). Only LOOP BEGIN INSERT ...; EXIT; EXCEPT

[GENERAL] database error xx000?

2012-04-26 Thread Kenneth Tilton
I am doing a ton of pgsql over here defining and redefining functions and triggers and every day or so I get this: Error: Database error XX000: cache lookup failed for type 5276542 > > Query: select dcm.task_user_dispos(42895::bigint, 870::bigint) > > [condition type: internal-error] > > If I exi

Re: [GENERAL] database error xx000?

2012-04-26 Thread Tom Lane
Kenneth Tilton writes: > I am doing a ton of pgsql over here defining and redefining functions and > triggers and every day or so I get this: > Error: Database error XX000: cache lookup failed for type 5276542 > Does the above give anyone any ideas at all about what is going on? No. Can you pr

Re: [GENERAL] database error xx000?

2012-04-26 Thread Kenneth Tilton
On Thu, Apr 26, 2012 at 2:24 PM, Tom Lane wrote: > Kenneth Tilton writes: > > I am doing a ton of pgsql over here defining and redefining functions and > > triggers and every day or so I get this: > > > Error: Database error XX000: cache lookup failed for type 5276542 > > > Does the above give a

Re: [GENERAL] database error xx000?

2012-04-26 Thread dennis jenkins
On Thu, Apr 26, 2012 at 1:59 PM, Kenneth Tilton wrote: > On Thu, Apr 26, 2012 at 2:24 PM, Tom Lane wrote: > > >> Can you produce a self-contained test case? >> > > I doubt it. Every test iteration I run includes a lot of redefining of > functions and triggers all over the map, and it works fine

[GENERAL] Which data type to use for UTF8 JSON and perl/PHP: varchar, text or bytea?

2012-04-26 Thread Alexander Farber
Hello, I run a small card game with PostgreSQL 8.4.11 on CentOS 6 at https://apps.facebook.com/video-preferans/ List of databases Name| Owner | Encoding | Collation |Ctype| Access privileges ---+--+--+-+

Re: [GENERAL] Which data type to use for UTF8 JSON and perl/PHP: varchar, text or bytea?

2012-04-26 Thread Merlin Moncure
On Thu, Apr 26, 2012 at 2:45 PM, Alexander Farber wrote: > Hello, > > I run a small card game with PostgreSQL 8.4.11 on > CentOS 6  at https://apps.facebook.com/video-preferans/ > >                                  List of databases > Name    |  Owner   | Encoding |  Collation  |    Ctype    |   A

Re: [GENERAL] database error xx000?

2012-04-26 Thread Kenneth Tilton
On Thu, Apr 26, 2012 at 3:07 PM, dennis jenkins wrote: > On Thu, Apr 26, 2012 at 1:59 PM, Kenneth Tilton wrote: > >> On Thu, Apr 26, 2012 at 2:24 PM, Tom Lane wrote: >> >> >>> Can you produce a self-contained test case? >>> >> >> I doubt it. Every test iteration I run includes a lot of redefini

[GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-04-26 Thread Dmitry Koterov
Hello. For example, I have 2 functions like these: CREATE OR REPLACE FUNCTION first(a INTEGER, b INTEGER, ...) RETURNS ... AS $body$ ...any SQL which uses $1, $2 etc. arguments, plus LIMIT $3... $body$ LANGUAGE 'sql' *STABLE* and CREATE OR REPLACE FUNCTION second(a INTEGER, b INTEGER, ...)

Re: [GENERAL] Which data type to use for UTF8 JSON and perl/PHP: varchar, text or bytea?

2012-04-26 Thread Alexander Farber
Hello, On Thu, Apr 26, 2012 at 10:11 PM, Merlin Moncure wrote: >> Does anybody have an advice on what data type >> to use best for such a JSON "string"? >> >> Should I take varchar, text or bytea. >> >> And for the latter - how to handle it in Perl >> if I currently use DBI and DBD::Pg? >> >> For

Re: [GENERAL] Which data type to use for UTF8 JSON and perl/PHP: varchar, text or bytea?

2012-04-26 Thread Merlin Moncure
On Thu, Apr 26, 2012 at 3:46 PM, Alexander Farber wrote: > Hello, > > On Thu, Apr 26, 2012 at 10:11 PM, Merlin Moncure wrote: >>> Does anybody have an advice on what data type >>> to use best for such a JSON "string"? >>> >>> Should I take varchar, text or bytea. >>> >>> And for the latter - how

Re: [GENERAL] Bug? Query plans / EXPLAIN using gigabytes of memory

2012-04-26 Thread Tom Lane
Toby Corkindale writes: > I've created a bit of a test case now. > There's a Perl script here: > http://dryft.net/postgres/ AFAICT, what is happening is that we're repeating the planning of that messy nest of views for each child table of foo. For most of the children the planner eventually deci

Re: [GENERAL] PHP SQL Color Syntax that is Postgresql & GPL3 Compatible?

2012-04-26 Thread Ken Tanzer
I took a look. The syntax highlighting in phpPgAdmin is nicely self-contained in one file, and BSD-licensed. Unfortunately the actual highlighting is less advanced than some others. (I've gotten spoiled by vim, but suspect it's not written in PHP!) Now I'm looking at a couple of javascript opti

Re: [GENERAL] PHP SQL Color Syntax that is Postgresql & GPL3 Compatible?

2012-04-26 Thread John DeSoi
On Apr 26, 2012, at 11:23 PM, Ken Tanzer wrote: > I took a look. The syntax highlighting in phpPgAdmin is nicely > self-contained in one file, and BSD-licensed. Unfortunately the actual > highlighting is less advanced than some others. (I've gotten spoiled by vim, > but suspect it's not wri