Re: plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!

From: Pawel Dubin <paweld(at)suimed(dot)tpnet(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: plz, Help!! HOW CAN I GET THE ROWNUM IN POSTGRES TABLE AS I DID WITH ORACLE!!
Date: 2000-11-24 13:48:27
Message-ID: 00112413482700.00757@paweld.sucha.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

List z dnia: Pi? 24. Listopad 2000 05:51, :
> On Fri, Nov 24, 2000 at 08:35:34AM +0300, some SMTP stream spewed forth:
> > On Mon, Nov 20, 2000 at 12:44:20PM +0800, BaiJie wrote:
> > > I KNOW THERE IS A OID FIELD ,BUT IT 'S WIRED , NOT A INTEGER INDEX FROM
> > > I TO CURRENT ROW NUMBER!! HOW CAN I GET THE TRUE ROW NUMBER IN
> > > POSTGRESQL!!
> >
> > At first, don't use all caps.
>
> Heh, I was waiting for something like that.
>
I was resolved this problem with my own int field (or whatever You want)
(if it is ok for You) and
then defined table like this:

create sequence test_seq;
create table test (
...
data
...
test id int4 default nextval('test_seq')
};

create index on that field

reason:
problem with copying data with relations to other databases

> > --
> > Igor' Robul', Unix System Administrator & Programmer @ sanatorium
> > "Raduga", Sochi, Russia
> > http://www.brainbench.com/transcript.jsp?pid=304744

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2000-11-24 14:43:07 Re: create snapshot?
Previous Message ghaverla 2000-11-24 12:54:12 Re: Skipping numbers in a sequence.