Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8EC1D63352E for ; Wed, 4 Aug 2010 17:08:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 84561-03-2 for ; Wed, 4 Aug 2010 20:08:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.officenet.no (unknown [195.159.87.244]) by mail.postgresql.org (Postfix) with ESMTP id 9484B633308 for ; Wed, 4 Aug 2010 17:08:00 -0300 (ADT) Received: from [79.161.204.50] (helo=[192.168.0.186]) by ns1.officenet.no with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OgkFm-0005kH-Bc for pgsql-sql@postgresql.org; Wed, 04 Aug 2010 22:07:57 +0200 Message-ID: <4C59C89A.7070401@officenet.no> Date: Wed, 04 Aug 2010 22:07:54 +0200 From: Andreas Joseph Krogh User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: workaround for missing ROWNUM feature with the help of GUC variables References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------070506010404080301060909" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.304 tagged_above=-5 required=5 tests=BAYES_05=-0.5, HTML_MESSAGE=0.001, RDNS_NONE=0.793, T_FILL_THIS_FORM_SHORT=0.01 X-Spam-Level: X-Archive-Number: 201008/24 X-Sequence-Number: 34464 This is a multi-part message in MIME format. --------------070506010404080301060909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 08/04/2010 12:35 PM, Marc Mamin wrote: > > Hello, > > here my two pence on this recurring thema. > > (just a workaround) > > I don't understand what you mean by missing ROWNUM feature, PG got this with windows-functions in 8.4: http://www.postgresql.org/docs/8.4/interactive/functions-window.html Example: select username, row_number() over() from my_user_table; username | row_number -------------+------------ admin | 1 everyone | 2 -- Andreas Joseph Krogh Senior Software Developer / CTO ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Rosenholmveien 25 | know how to do a thing and to watch | 1414 Trollåsen | somebody else doing it wrong, without | NORWAY | comment. | | | Tlf: +47 24 15 38 90 | | Fax: +47 24 15 38 91 | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+ --------------070506010404080301060909 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 08/04/2010 12:35 PM, Marc Mamin wrote:

Hello,

 

here my two pence on this recurring thema.

 

(just a workaround)



I don't understand what you mean by missing ROWNUM feature, PG got this with windows-functions in 8.4:
http://www.postgresql.org/docs/8.4/interactive/functions-window.html

Example:
select username, row_number() over() from my_user_table;
  username   | row_number
-------------+------------
 admin       |          1
 everyone    |          2

-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Rosenholmveien 25       | know how to do a thing and to watch         |
1414 Trollåsen          | somebody else doing it wrong, without       |
NORWAY                  | comment.                                    |
                        |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+
--------------070506010404080301060909--