Re: varchar lengths

From: Richard Huxton <dev(at)archonet(dot)com>
To: Marcus Engene <mengpg2(at)engene(dot)se>
Cc: POSTGRESQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: varchar lengths
Date: 2010-09-21 10:05:22
Message-ID: 4C988362.7040405@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21/09/10 10:40, Marcus Engene wrote:
> Hi list,
>
> In Oracle I can...
> create table a
> (
> b varchar2(10 chars)
> );
> ...and then, regardless of character encoding and how much space an
> ascii character vs a ö takes, 10 characters will fit there.

> Is there anything I've misunderstood? How does the rest of you deal with
> this situation?

PostgreSQL actually measures length in characters anyway, so varchar(10)
always holds 10 characters, whatever they are.

You'll need to have the appropriate database encoding for those
characters of course.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Massa, Harald Armin 2010-09-21 11:23:45 Re: varchar lengths
Previous Message A B 2010-09-21 09:42:41 What is the effect of locale on numbers?