Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-12 Thread Xharon
ctid is the physical location of the row version, so it's not static.. check http://www.postgresql.org/docs/8.2/static/ddl-system-columns.html -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
:05 To: 'Pavel Stehule'; D'Arcy J.M. Cain Cc: pgsql-sql@postgresql.org Subject: RE: [SQL] Updating a specific number of rows in pl/pgsql > there are one fast trick > http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Fast_first_n_rows_removing Thanks - that's a ver

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Pavel Stehule
sday, August 11, 2009 03:55 > To: D'Arcy J.M. Cain > Cc: Peter Headland; pgsql-sql@postgresql.org > Subject: Re: [SQL] Updating a specific number of rows in pl/pgsql > > 2009/8/11 D'Arcy J.M. Cain : >> On Mon, 10 Aug 2009 17:52:36 -0700 >> "Peter Headland&q

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
m: Pavel Stehule [mailto:pavel.steh...@gmail.com] Sent: Tuesday, August 11, 2009 03:55 To: D'Arcy J.M. Cain Cc: Peter Headland; pgsql-sql@postgresql.org Subject: Re: [SQL] Updating a specific number of rows in pl/pgsql 2009/8/11 D'Arcy J.M. Cain : > On Mon, 10 Aug 2009 17:52:36 -0700 > "Pet

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Peter Headland
c: pgsql-sql@postgresql.org Subject: Re: [SQL] Updating a specific number of rows in pl/pgsql On Mon, 10 Aug 2009 17:52:36 -0700 "Peter Headland" wrote: > I can get the rows I want to update like this: > > SELECT * >FROM queue >WHERE id = p_queue

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread Pavel Stehule
2009/8/11 D'Arcy J.M. Cain : > On Mon, 10 Aug 2009 17:52:36 -0700 > "Peter Headland" wrote: >> I can get the rows I want to update like this: >> >>   SELECT * >>    FROM queue >>    WHERE id = p_queue_id >>    ORDER BY rank >>    LIMIT p_number_of_items; >> >> Of course, there may not be p_number_

Re: [SQL] Updating a specific number of rows in pl/pgsql

2009-08-11 Thread D'Arcy J.M. Cain
On Mon, 10 Aug 2009 17:52:36 -0700 "Peter Headland" wrote: > I can get the rows I want to update like this: > > SELECT * >FROM queue >WHERE id = p_queue_id >ORDER BY rank >LIMIT p_number_of_items; > > Of course, there may not be p_number_of_items available in the queue. > > I

[SQL] Updating a specific number of rows in pl/pgsql

2009-08-10 Thread Peter Headland
I'm working on a queuing application. As part of this I'm trying to write a pl/pgsql function that updates a specific number of rows in the most efficient way possible. Multiple queues are contained within a single table. I can get the rows I want to update like this: SELECT * FROM queue