Home > Archive > PostgreSQL Newbies > November 2005 > Re: How do I get an OID from a record in table?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How do I get an OID from a record in table?
Jaime Casanova

2005-11-29, 9:24 am

On 11/29/05, Norberto Meijome <sys@meijome.net> wrote:
> Jaime Casanova wrote:
> On 11/26/05, Scott Simpson <Scott.Simpson@computer.org> wrote:


> If I create a table with an OID field type, how do I set that field
> type?

That is, I have to look up the OID value in another table somewhere to
> set

my OID field and I don't know how to do that. (I'm trying to get one
> field

to point to another record). ADVthanksANCE.


> SELECT oid FROM your_referenced_tabl
e;


oid is an especial field that is
> present in all row unless you had

specified WITHOUT OIDS...

i think in 8.1
> WITHOUT OIDS is the DEFAULT...


it's not a good idea to do what you want to
> do... use a serial instead



> Jaime,
> if one is not specifically using OIDs (as you described above), is there
> any advantage to have tables defined WITH OIDs ? would it be better to alter
> the tables to WITHOUT OID (and then pg_dump and load again, i guess)
>
> thanks!
> Beto
>


The preferred way is to not use OID's in user tables... but AFAICS,
you will have no problem if you simply let them there (there is no
need for ALTERing and DUMPing)... i don't know if it will be a
reduction in the space if you don't have OIDs, will be?


--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com