Re: [HACKERS] Re: varchar() troubles

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: varchar() troubles
Date: 1998-01-12 17:13:58
Message-ID: 34BA4F56.5150E62F@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Pretty sure only after but it's hard to tell for sure. My trees for 971204
> and 971222 both core dump on inserts to varchar, but I can't remember what
> else I was doing with the trees at the time.

I now recall that the varchar code was broken during this time (for who knows
how long?), as I discovered when trying to reproduce the tutorial results for
the documentation.

The problem was that some things were copied using VARSIZE rather than
subtracting out VARHDRSZ first (actually, I think it might have use
sizeof(int) and other dangers too). I patched that near the end of the year
and my 980101.d tree and 980106.d tree do not exhibit the symptom:

postgres=> create table t (v varchar(80),i int);
CREATE
postgres=> insert into t values ('hi', 1);
INSERT 643562 1
postgres=> select * from t;
v |i
--+-
hi|1
(1 row)

Hope this helps :/

- Tom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mattias Kregert 1998-01-12 17:18:47 Re: [HACKERS] Storing rows bigger than one block
Previous Message Bruce Momjian 1998-01-12 16:35:55 Re: [BUGS] General Bug Report: palloc fails with lots of ANDs and ORs