Re: char() or varchar() for frequently used column

From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: char() or varchar() for frequently used column
Date: 2002-10-17 09:23:30
Message-ID: 200210170924.g9H9OSTW020891@artemis.cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tan ga 2002-10-17 09:31:06 Trying to transform results of dow
Previous Message paul butler 2002-10-17 08:24:06 Re: char() or varchar() for frequently used column