Re: char() or varchar() for frequently used column
От | Jules Alberts |
---|---|
Тема | Re: char() or varchar() for frequently used column |
Дата | |
Msg-id | 200210170924.g9H9OSTW020891@artemis.cuci.nl обсуждение исходный текст |
Ответ на | Re: char() or varchar() for frequently used column ("paul butler" <paul@entropia.co.uk>) |
Ответы |
Re: char() or varchar() for frequently used column
|
Список | pgsql-novice |
On 17 Oct 2002 at 9:24, paul butler wrote: <snip> > That way your future proofed, varchar without brackets is unlimited Thanks a lot, I didn't know that. > and while I know you didn't ask > > create table country ( > code varchar primary key, > name varchar not null unique; > insert into country (code, name) values ('NL', 'Nederland'); > insert into country (code, name) values ('BE', 'Belgie'); > > create table gender ( > code varchar primary key, > name varchar not null unique); > insert into gender (code, name) values ('M', 'male'); > insert into gender (code, name) values ('F', 'female'); > > might serve just as well I have considered this. As a matter of fact, that is the way it is in our current db but I'm not really happy with it. Theoretically CODE should never change and is therefore safe to use as primary key. But having an "extra" serial primary key will make the db more flexible regarding to unforeseen complications. > Hope this helps It did, thanks again.
В списке pgsql-novice по дате отправления: