Skip site navigation (1) Skip section navigation (2)

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

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Scott Simpson <Scott(dot)Simpson(at)computer(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How do I get an OID from a record in table?
Date: 2005-11-27 00:12:24
Message-ID: c2d9e70e0511261612j56bbf205o676cf97dfd1ab25@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 11/26/05, Scott Simpson <Scott(dot)Simpson(at)computer(dot)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_table;

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

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

In response to

Responses

pgsql-novice by date

Next:From: Marcus EngeneDate: 2005-11-27 00:38:44
Subject: Re: Linux Format Gambas Easy Database Access!
Previous:From: john hedgeDate: 2005-11-27 00:01:16
Subject: Linux Format Gambas Easy Database Access!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group