Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Tom Lane
Volkan YAZICI <[EMAIL PROTECTED]> writes: > On Thu, 17 Jul 2008, Alvaro Herrera <[EMAIL PROTECTED]> writes: >> They are two different lock spaces. pg_advisory_lock does not conflict >> with regular system locks, whereas LOCK TABLE does. > Is this documented in somewhere? I couldn't figure out tha

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Volkan YAZICI
On Thu, 17 Jul 2008, Alvaro Herrera <[EMAIL PROTECTED]> writes: > Volkan YAZICI wrote: >> What's the difference between below two queue implementations? > > They are two different lock spaces. pg_advisory_lock does not conflict > with regular system locks, whereas LOCK TABLE does. Is this documen

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Alvaro Herrera
Volkan YAZICI wrote: > Hi, > > What's the difference between below two queue implementations? They are two different lock spaces. pg_advisory_lock does not conflict with regular system locks, whereas LOCK TABLE does. -- Alvaro Herrerahttp://www.CommandPrompt.co

Re: [SQL] Generating table rows from arrays

2008-07-17 Thread Florian Weimer
* Richard Huxton: >> The first row is constant. I could write a loop with PL/pgsql, I >> guess, but I wonder if there are better options nowadays. > > The smallest function I've seen is Merlin Moncure's here: > > http://people.planetpostgresql.org/merlin/index.php?/archives/4-fun-with-arrays.html

Re: [SQL] How to GROUP results BY month

2008-07-17 Thread Oliveiros Cristina
All, Thanks a million for your help and thoughtful considerations. From this thread I learned lots. As my concrete problem just concerns one year, I used the extract function, but I ve mentally wrote down the date_trunc construct as suggested by Herouth Andreas and Scott, thanks for the tips

Re: [SQL] Generating table rows from arrays

2008-07-17 Thread Pavel Stehule
Hello se own unpack sql function http://www.pgsql.cz/index.php/PostgreSQL_SQL_Tricks#Array_to_table Regards Pavel Stehule 2008/7/17 Florian Weimer <[EMAIL PROTECTED]>: > Is there a convenient way to turn an array into table rows? For > example, I've got an array like {1, 2, 3} and would like t

Re: [SQL] Generating table rows from arrays

2008-07-17 Thread Richard Huxton
Florian Weimer wrote: Is there a convenient way to turn an array into table rows? For example, I've got an array like {1, 2, 3} and would like to insert rows: ('aaa', 1) ('aaa', 2) ('aaa', 3) The first row is constant. I could write a loop with PL/pgsql, I guess, but I wonder if there a

[SQL] Generating table rows from arrays

2008-07-17 Thread Florian Weimer
Is there a convenient way to turn an array into table rows? For example, I've got an array like {1, 2, 3} and would like to insert rows: ('aaa', 1) ('aaa', 2) ('aaa', 3) The first row is constant. I could write a loop with PL/pgsql, I guess, but I wonder if there are better options nowada

Re: [SQL] PERSISTANT PREPARE (another point of view)

2008-07-17 Thread Richard Huxton
Milan Oparnica wrote: Milan Oparnica wrote: It's simply to complicated to return recordsets through server-side stored procedures. They are obviously designed to do complex data manipulation, returning few output variables informing the caller about final results. Returning records through s