From: | rolf(dot)ostvik(at)axxessit(dot)no |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Using oids |
Date: | 2003-09-04 06:16:29 |
Message-ID: | OF8865C975.837EFEDE-ONC1256D97.00219BD4@axxessit.no |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
on 2003-09-03 13:47 Bo Lorentsen <bl(at)netgroup(dot)dk> wrote:
>No it don't know anything about the table it insert into. I simply do
>the following :
>1. INSERT data (comming from another layer)
>2. Get the last oid
>3. SELECT * FROM the same table where oid = what I just found.
>I know absolutly nothing about the table, and I like it this way :-)
I am not sure where the best place would be to jump into the discussion
with my suggestion so i do it her.
The problem is that someone use the OID as an identifier which always is
there, and you always use the same method to extract it, while at the same
time the use of OID is not advisable.
One alternative could be to create one sequence and use this sequence as a
identifier in all tables.
This would be a little bit more work when creating the table, but it would
be easier to extract the last used value from the sequence than it is to
extract it from the OID (since i really haven't loooked into how to
extract the OID in a easy way).
This will of course duplicate the function of the OID which (as of
present) always is there.
--
Rolf
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-09-04 06:33:05 | Re: Optimizer picks an ineffient plan |
Previous Message | Greg Stark | 2003-09-04 06:16:21 | Re: Optimizer picks an ineffient plan |