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

Re: db design question

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: db design question
Date: 2002-10-17 06:11:09
Message-ID: 200210170614.g9H6EYTW017437@artemis.cuci.nl (view raw or flat)
Thread:
Lists: pgsql-novice
On 16 Oct 2002 at 9:19, Josh Berkus wrote:
<snip>
> Instead of using the row_oid for the standard tables, though, consider
> doing this:
> 
> 1) Create a table-independant sequence, "global_seq"
> 2) Make the primary key of each significant table DEFAULT NEXTVAL
> ('global_seq') instead of SERIAL.
> 3) Reference the primary keys in your blobs table, instead of the OID.
> 
> The above will work as well as using the OID, without the potential
> headaches and with a greater degree of control.
<snip>

I hadn't thought of that approach. Sounds like a workable solution, but 
then again, so does the OID way. I allways prefer to keep things as 
simple as possible, using the most commonly applicated method.

Both OIDs and sequences exist and should do the job, but the question 
is, which one is more reliable? Which one will keep it's current 
syntax, functionality etc. longest? The db I'm designing will be the 
core of my companies IT and will be in use for at least 5 years (the 
current one is into its 7th) and a lot can change in that time. That's 
why these decisions are so important now, on what horse do I put my 
money?

I'll have a closer look at sequences, thanks for sharing your solution!

In response to

pgsql-novice by date

Next:From: Jules AlbertsDate: 2002-10-17 07:23:14
Subject: char() or varchar() for frequently used column
Previous:From: Eric WalstadDate: 2002-10-17 06:04:17
Subject: Re: PostgreSQL 7.2.1 Programmer's Guide in pdf format

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