Re: [SQL] Table design question

2006-06-01 Thread David Clarke
On 6/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Thu, 01 Jun 2006, Chris Browne wrote: > Celko is decidedly *NOT* promoting the notion that you should use a > 100 byte long "natural key." > > Jamie's comments of "Orthodox versus Reform" seem reasonably > appropriate in outlining someth

Re: [SQL] Table design question

2006-06-01 Thread postgres
On Thu, 01 Jun 2006, Chris Browne wrote: > Celko is decidedly *NOT* promoting the notion that you should use a > 100 byte long "natural key." > > Jamie's comments of "Orthodox versus Reform" seem reasonably > appropriate in outlining something of the difference between the > positions. Just to

Re: [SQL] Table design question

2006-06-01 Thread Chris Browne
"codeWarrior" <[EMAIL PROTECTED]> writes: > I never use anything other than "id SERIAL NOT NULL PRIMARY KEY" for my > PKEY's -- as an absolute rule -- I guess I am a purist... Everything else > (the other columns) can have unique constraints, etcetera and be FOREIGN > KEYS, etc... > > Try INSER

Re: [SQL] Table design question

2006-06-01 Thread codeWarrior
I never use anything other than "id SERIAL NOT NULL PRIMARY KEY" for my PKEY's -- as an absolute rule -- I guess I am a purist... Everything else (the other columns) can have unique constraints, etcetera and be FOREIGN KEYS, etc... Try INSERTING your 100 character "natural" key into a table wi

Re: [SQL] Table design question

2006-06-01 Thread postgres
On Thu, 01 Jun 2006, David Clarke wrote: > So I'm designing a table and I'm looking for an appropriate key. The > natural key is a string from a few characters up to a maximum of > perhaps 100. Joe gets quite fierce about avoiding the use of a serial > id column as a key. The string is unique in t

Re: [SQL] Table design question

2006-06-01 Thread Greg Stark
"David Clarke" <[EMAIL PROTECTED]> writes: > is it really that big an issue these days to have a 100 character primary > key? Are there postgres-specific implications for either approach? It's exactly the same size issue as ever. A 20% increase in space usage is a 20% performance hit in certain

Re: [SQL] Table design question

2006-06-01 Thread Rod Taylor
> So I'm designing a table and I'm looking for an appropriate key. The > natural key is a string from a few characters up to a maximum of > perhaps 100. Joe gets quite fierce about avoiding the use of a serial > id column as a key. The string is unique in the table and fits the > criteria for a key

[SQL] Table design question

2006-06-01 Thread David Clarke
I'm reading Joe Celko's book SQL Programming Style for the second time and although I've been an OO developer for quite a few years I'm fairly green wrt SQL. Joe is obviously something of a curmudgeon and I would fall squarely into his newbie OO developer ordinal scale and I'm trying to avoid the