Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55]) by hub.org (8.10.1/8.10.1) with ESMTP id e57FVdW37792; Wed, 7 Jun 2000 11:31:39 -0400 (EDT) Received: from austin.rr.com ([24.93.36.87]) by Mail.austin.rr.com with Microsoft SMTPSVC(5.5.1877.357.35); Wed, 7 Jun 2000 10:18:15 -0500 Message-ID: <393E6C2A.825BF2B7@austin.rr.com> Date: Wed, 07 Jun 2000 10:37:14 -0500 From: Ed Loehr X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686) X-Accept-Language: en MIME-Version: 1.0 To: mikeo CC: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Re: [SQL] oracle rownum equivalent? References: <3.0.1.32.20000607082428.00925870@pop.spectrumtelecorp.com> <3.0.1.32.20000607101423.00930360@pop.spectrumtelecorp.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200006/202 mikeo wrote: > > thanks for the response. oid is equivalent to oracle rowid. > rownum can be used similar to the limit option of select in postgres > but in oracle it can also be used in a where clause, or as an assigment > in an update statement for instance. > > eg: update ctmaster set bsc_id = mod(rownum,3) +1; > > this gives me a way to assign streams to rows in a load balanced manner > on the fly, for example. i use it in other more involved ways than this > also. i cannot do this with limit. i could do this with sequence with > a max value but i'd have to define a sequence each time i wanted to do > something "on the fly" or for what ifs. > > what i'm also interested in is how to find reference to these type of > pseudo-columns, even just the names of them, if they're listed somewhere. I think this might be the list, but you might query pgsql-hackers for more info. There was a recent thread involving this.. ctid oid xmin (minimum transaction number) xmax cmin (minimum command number) cmax ctid may be what you're looking for, but I don't understand very well how these are used. Maybe someone else can say or you can experiment... Regards, Ed Loehr (PS: Posting to only one of -general or -sql will almost always be sufficient.)