[Q] Examples of using OIDs

Started by Sergey Kryazhevskihabout 27 years ago2 messagesgeneral
Jump to latest
#1Sergey Kryazhevskih
serg@ors.kirov.ru

Hello

Sorry my silly question, but I can't quite undestand what is OID for ?
More cleary, I can't undestand a way of using OID.

Can sombody give me some examples of using OIDs ? How can I get OID of
tables and how use table's OID in SQL-request.

I would appreciate any response,
Sergey

---
Sergey Kryazhevskih serg@ors.kirov.ru
System Development Group http://www.ors.kirov.ru/~serg

#2Evan Howarth
EHowarth@Intellicall.com
In reply to: Sergey Kryazhevskih (#1)
RE: [GENERAL] [Q] Examples of using OIDs

This will return all columns including the OID:
select oid,* from my_table

To index the OID column:
create index my_table_oid on my_table( oid )

Other tables can reference the OID column:
create table another_table (
...
my_table_ref oid not null,
..
)

Because PostreSQL ignores the "foreign key" keywords,
you have to maintain referential integrity yourself.

Evan Howarth