Re: [SQL] Alternative to serial primary key

2006-07-06 Thread Sander Steffann

Hi,


But having a hash function over the address
column as the primary key means I can always regenerate my primary key


Warning: don't attach a meaning to a primary key, as it might change

- Sander



---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org


Re: [SQL] Alternative to serial primary key

2006-07-07 Thread Sander Steffann
Hi D'Arcy,

> It's not that I think that the primary key should never have 
> meaning in the database (I use the two letter country code as 
> the PK in my country table for example) I just think that 
> it's dangerous ground and should be tread very carefully.

You are right. I now realize that I have done exactly the same thing in my
database designs :)  In 95+% of the cases I would choose a serial, but this
is a good counter-example.

Thanks for making me think :)
Sander


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match