From: | Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk> |
---|---|
To: | maillist(at)candle(dot)pha(dot)pa(dot)us, lockhart(at)alumni(dot)caltech(dot)edu |
Cc: | hackers(at)postgresql(dot)org |
Subject: | Re: [HACKERS] varchar() troubles |
Date: | 1998-01-12 18:24:00 |
Message-ID: | 199801121824.SAA28112@mtcc.demon.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I can confirm that I see the same problem here.
Maybe todo with the recent varchar() storage changes.
Keith.
"Thomas G. Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
> I've been seeing trouble with varchar() columns for a little while, and
> since it is still there with a fresh install of the development tree
> it's time to report it:
>
> postgres=> create table t (v varchar(80),i int);
> CREATE
> postgres=> insert into t values ('hi',1);
> INSERT 18122 1
> postgres=> select * from t;
> v |i
> --+-
> hi|0
> (1 row)
>
> As you can see, the varchar() column apparently trashes the subsequent
> column. I ran across it trying to verify the tutorial examples for the
> documentation. If the varchar() is the last column in the table, the
> problem does not crop up, at least in the simplest case:
>
> postgres=> create table t2 (i int, v varchar(80));
> CREATE
> postgres=> insert into t2 values (2,'hi');
> INSERT 18133 1
> postgres=> select * from t2;
> i|v
> -+--
> 2|hi
> (1 row)
>
> Also, I believe that if the varchar() field is substantially shorter the
> problem does not manifest itself:
>
> postgres=> create table t4 (v varchar(4), i int);
> CREATE
> postgres=> insert into t4 values ('hi',4);
> INSERT 18156 1
> postgres=> select * from t4;
> v |i
> --+-
> hi|4
> (1 row)
>
> but varchar(10) still shows the problem:
>
> postgres=> create table t3 (v varchar(10), i int);
> CREATE
> postgres=> insert into t3 values ('hi',3);
> INSERT 18145 1
> postgres=> select * from t3;
> v |i
> --+-
> hi|0
> (1 row)
>
> This is from the development source as of around 1998-01-12 14:30 GMT
>
> -
> Tom
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Kevin Witten | 1998-01-12 18:33:10 | (no subject) |
Previous Message | The Hermit Hacker | 1998-01-12 18:12:59 | ODBC & LGPL license... |