Re: OID

From: Lloyd Vancil <lev(at)apple(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: OID
Date: 2002-04-05 17:17:40
Message-ID: a05101008b8d38bb15480@[17.219.158.43]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

One of the books you recommend, Introduction and concepts,
specifically notes using OID as a unique for primary and foreign keys.
Pg 80.

If there is a danger, Id like to know what it is, since I am using
the OID as a unique in a join to generate a list of records for
individual processing.

As long as you remember that you cannot set, or alter an OID
what's the diff?

L>

At 8:21 AM -0800 4/5/02, Josh Berkus wrote:
>Harald, Chris,
>
>> > 1. M$ SQL Server has an identity column which generates a
>> sequential number
>> > for you, we use this often for unique primary keys. Does postgres
>> support
>> > anything like this ?
>>
>> select *,oid from your_table
>
>NO!!!! This is wrong. DO NOT USE the oid for anything other than
> system purposes. It is NOT a user-friendly value for several reasons.
>
>Chris, the data type you want is SERIAL. Please read the section of
> the docs on sequences:
>http://www.postgresql.org/idocs/index.php?sql-createsequence.html
>... as the SERIAL datatype simply automates the creation of a sequence.
> BTW, postgres sequences are both more powerful and more user-friendly
> than MS SQL Identity columns.
>
>I would also strongly suggest buying a beginner's postgresql book, such
> as "PostgreSQL: Introduction and Concepts" or Wrox Press' PostgreSQL
> book.
>
>-Josh Berkus
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org

--
searchmaster(at)apple(dot)com
lev(at)apple(dot)com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message John Taylor 2002-04-05 18:24:14 Running out of Disk Space
Previous Message Joshua b. Jore 2002-04-05 17:04:38 Re: identity columns ?