Re: [Solved] SQL Server to PostgreSQL - Mailing list pgsql-general

From Jan Wieck
Subject Re: [Solved] SQL Server to PostgreSQL
Date
Msg-id 200009022333.SAA20793@jupiter.jw.home
Whole thread Raw
In response to Re: [Solved] SQL Server to PostgreSQL  (Martin Christensen <knightsofspamalot-factotum@mail1.stofanet.dk>)
Responses Re: [Solved] SQL Server to PostgreSQL  (Ian Turner <vectro@pipeline.com>)
List pgsql-general
Martin Christensen wrote:
> >>>>> "Radoslaw" == Radoslaw Stachowiak <radek@alter.pl> writes:
> Radoslaw> Does varchar(188) takes 188 bytes (+ bytes for length
> Radoslaw> storage) every time, no matter if it contains 'my text' or
> Radoslaw> 'my long 188 char text.....'  ?
>
> The way I understand it varchar(n) is variable-length, while char(n)
> is fixed-lenght. Thus the behaviour you describe above is that of
> char(n).

    Right for any pre-7.1 version.

    From  7.1  on  the  system  will  try  to  compress all types
    internally stored as variable length (char(), varchar(), text
    and  some  more). So the real amount of bytes for a char(188)
    will be "at maximum 192 - probably less".


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-general by date:

Previous
From: Martin Christensen
Date:
Subject: Re: [Solved] SQL Server to PostgreSQL
Next
From: Jan Wieck
Date:
Subject: Re: PL/Perl compilation error