Re: [SQL] installing uuid generators

2010-03-16 Thread Jorge Godoy
Perl and Python are external packages, not part of the main package. Here's the list: S | Name | Summary | Type --++---

Re: [SQL] installing uuid generators

2010-03-16 Thread Tom Lane
Rob Sargent writes: > As Tom suspected the SUSE build doesn't name ossp stuff, to wit: > CONFIGURE = '--prefix=/usr' '--libdir=/usr/lib64' '--bindir=/usr/bin' > '--includedir=/usr/include/pgsql' '--datadir=/usr/share/postgresql' > '--mandir=/usr/share/man' '--docdir=/usr/share/doc/packages' > '--

Re: [SQL] installing uuid generators

2010-03-16 Thread Rob Sargent
On 03/16/2010 02:26 PM, Tom Lane wrote: > Richard Huxton writes: >> On 16/03/10 18:08, Rob Sargent wrote: >>> I'm still left worried about the correct procedure for getting uuid-oosp >>> installed properly on SUSE 11. Does the server release's contrib >>> contain uuid-ossp? I didn't see it on

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Tom Lane
Richard Huxton writes: > On 16/03/10 21:09, Tom Lane wrote: >> If you don't expect this to be common, maybe you could fix the >> concurrency issue by taking a table-wide lock that locks out >> other writers. > Surely SELECT FOR UPDATE on the parents would be sufficient? If there's > no overlap b

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Richard Huxton
On 16/03/10 21:09, Tom Lane wrote: Tony Cebzanov writes: I'm okay with running the big, fat WITH RECURSIVE query in my insert trigger if I have to -- it won't be great for performance, but I don't expect this to be a frequent operation, so I'll accept the performance hit if it works. Unfortu

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Tom Lane
Tony Cebzanov writes: > I'm okay with running the big, fat WITH RECURSIVE query in my insert > trigger if I have to -- it won't be great for performance, but I don't > expect this to be a frequent operation, so I'll accept the performance > hit if it works. > Unfortunately I can't even get that w

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Tony Cebzanov
On 3/16/10 4:34 PM, Tom Lane wrote: > The same kind of problem exists for unique and foreign key constraints, > both of which use low-level locking mechanisms to catch such cases. > There's no way that I can see to express the "no cycle" constraint as a > uniqueness constraint unfortunately. You c

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Tom Lane
Richard Huxton writes: > On 16/03/10 19:45, Tony Cebzanov wrote: >> That's great to avoid looping forever on queries, but what about >> preventing anyone from inserting edges that would create cycles in the >> first place? I reckon I'll need a trigger of some sort, but nothing >> I've tried has e

Re: [SQL] installing uuid generators

2010-03-16 Thread Tom Lane
Richard Huxton writes: > On 16/03/10 18:08, Rob Sargent wrote: >> I'm still left worried about the correct procedure for getting uuid-oosp >> installed properly on SUSE 11. Does the server release's contrib >> contain uuid-ossp? I didn't see it on my desktop release. (I don't >> want to have to

Re: [SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Richard Huxton
On 16/03/10 19:45, Tony Cebzanov wrote: I'm using the following table to represent an acyclic directed graph: [snip] I see there is an example in the online docs for detecting cycles in recursive queries, and I've adapted the example query to the table above: [snip] That's great to avoid loop

Re: [SQL] installing uuid generators

2010-03-16 Thread Richard Huxton
On 16/03/10 18:08, Rob Sargent wrote: I'm still left worried about the correct procedure for getting uuid-oosp installed properly on SUSE 11. Does the server release's contrib contain uuid-ossp? I didn't see it on my desktop release. (I don't want to have to tell my mates to go through the iss

[SQL] Avoiding cycles in a directed graph

2010-03-16 Thread Tony Cebzanov
I'm using the following table to represent an acyclic directed graph: CREATE TABLE edge( id SERIAL PRIMARY KEY, child INTEGER NOT NULL, parent INTEGER, UNIQUE (child, parent) ); I see there is an example in the online docs for detecting cycles in recursive

Re: [SQL] installing uuid generators

2010-03-16 Thread Rob Sargent
On 03/16/2010 03:20 AM, Richard Huxton wrote: > On 15/03/10 23:58, Rob Sargent wrote: >> Stop me if you've heard this one before :) >> >> Given that pg_config --libdir yields "/usr/lib64" >> to where/what would you expect >> >>"AS '$libdir/uuid-ossp', 'uuid_generate_v5'" >> >> to resolve? >>

Re: [SQL] Rename Index - Deadlock

2010-03-16 Thread Scott Marlowe
On Tue, Mar 16, 2010 at 3:45 AM, Thomas Kenner wrote: > Hi, > > Each day I'm recreating the index my_index of the table my_table. Therefore I > create a new index my_index_new, drop the old index my_index, and rename the > new index: > ALTER INDEX my_index_new RENAME TO my_index; > > If an insert

Re: [SQL] Rename Index - Deadlock

2010-03-16 Thread Tom Lane
Thomas Kenner writes: > Each day I'm recreating the index my_index of the table my_table. Therefore I > create a new index my_index_new, drop the old index my_index, and rename the > new index: > ALTER INDEX my_index_new RENAME TO my_index; > If an insert or select statement is run at the same

[SQL] Rename Index - Deadlock

2010-03-16 Thread Thomas Kenner
Hi, Each day I'm recreating the index my_index of the table my_table. Therefore I create a new index my_index_new, drop the old index my_index, and rename the new index: ALTER INDEX my_index_new RENAME TO my_index; If an insert or select statement is run at the same time as the "ALTER INDEX ..

Re: [SQL] I, nead to capture the IP number from the PC how is running the script ...

2010-03-16 Thread Niklas Johansson
On 15 mar 2010, at 20.18, John Dizaro wrote: I, nead to capture the IP number from the PC how is running the script Check the documentation for System Information Functions: http://www.postgresql.org/docs/8.4/interactive/functions-info.html The function inet_client_addr() will return the ad

Re: [SQL] DROP RULE ... CASCADE

2010-03-16 Thread Tom Lane
Dmitriy Igrishin writes: > What objects may depend on the rule (and which of them will removed via > cascade rule deletion)? At present I don't think that a rule can have any dependent objects. The CASCADE option is there for symmetry and future-proofing. (The same goes for some other types of ob

[SQL] SQL code beautifier for PostgreSQL.

2010-03-16 Thread Dmitriy Igrishin
Hey all, Is there any good SQL code beautifier for PostgreSQL to use with Emacs or other text editors? Unfortunately, pg_dump(1) does not format views and rules... It would be nice if we could format unreadable views and rules definitions in favorite editor... Regards, Dmitriy Igrishin

[SQL] DROP RULE ... CASCADE

2010-03-16 Thread Dmitriy Igrishin
Hey all, What objects may depend on the rule (and which of them will removed via cascade rule deletion)? Regards, Dmitriy Igrishin

Re: [SQL] installing uuid generators

2010-03-16 Thread Richard Huxton
On 15/03/10 23:58, Rob Sargent wrote: Stop me if you've heard this one before :) Given that pg_config --libdir yields "/usr/lib64" to where/what would you expect "AS '$libdir/uuid-ossp', 'uuid_generate_v5'" to resolve? The loader script, ~/tools/postgresql-8.4.2/contrib/uuid-ossp/uuid-ossp

Re: [SQL] list of all months

2010-03-16 Thread Jasen Betts
On 2010-03-08, query wrote: > --=_484d28810a276e7b5e461f0328ee205f > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; charset="UTF-8" > > Hi, > > I want to display data for all days in a month even if no data > exists for that month. Some of the days in a month might not have any > data

[SQL] pgAgent stats

2010-03-16 Thread Marcin Krawczyk
Hi list, does anyone know the reason for pgAdmin not showing the stats neither for selected pgAgent step nor whole job ? The pga_joblog and pga_jobsteplog both get populated with data on run so I was thinking that maybe I'm missing some view associated with statistics tabs ?? Any ideas ? regards