Re: increment row number function question - Mailing list pgsql-general

From Ron Johnson
Subject Re: increment row number function question
Date
Msg-id 452843D1.1030507@cox.net
Whole thread Raw
In response to Re: increment row number function question  (Matthew Peter <survivedsushi@yahoo.com>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/07/06 18:47, Matthew Peter wrote:
>> Thanks for the reply. Even if such a function existed, it would
>> almost certainly not do what you want in this query.  Per SQL
>> spec, the SELECT target list is logically supposed to be
>> evaluated before the ORDER BY and LIMIT steps, which means you'd
>> get numbers associated with the physical ordering of the rows not
>> their some_col ordering.
>
> Shucks. I wanted to return a set with an ordered iterator
> determined by the ORDER BY. Could that be done? regards, tom lane

A stored procedure should do the trick, no?

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFKEPRS9HxQb37XmcRAiRrAJ4vVxbhzwwH/8vWoZHH76lI4dT9kACg5zvH
ufGPSbGV0wHCvmkCPWjiI1U=
=PUKR
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Martin Steffen
Date:
Subject: Re: failure to connect to postgres DB via pg.el
Next
From: Jonathan Vanasco
Date:
Subject: Re: performace review