Re: char() or varchar() for frequently used column - Mailing list pgsql-novice

From Jules Alberts
Subject Re: char() or varchar() for frequently used column
Date
Msg-id 200210170924.g9H9OSTW020891@artemis.cuci.nl
Whole thread Raw
In response to Re: char() or varchar() for frequently used column  ("paul butler" <paul@entropia.co.uk>)
Responses Re: char() or varchar() for frequently used column
List 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 by date:

Previous
From: "paul butler"
Date:
Subject: Re: char() or varchar() for frequently used column
Next
From: Tan ga
Date:
Subject: Trying to transform results of dow