Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: sferac(at)bo(dot)nettuno(dot)it, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR
Date: 1998-02-05 17:00:48
Message-ID: 199802051700.MAA01607@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Do we need to disallow varchar() and char() without a length?

>
> > There's an error while inserting data into a column defined as VARCHAR without
> > length in PostgreSQL 6.3.
> > Take a look:
> >
> > postgres=> CREATE TABLE prova ( uno VARCHAR(10) );
> > CREATE
> > postgres=> INSERT INTO prova VALUES ( 'OK' );
> > INSERT 153042 1
> >
> > postgres=> CREATE TABLE prova2 ( uno VARCHAR );
> > CREATE
> > postgres=> INSERT INTO prova2 VALUES ( 'NOT OK' );
> > PQexec() -- Request was sent to backend, but backend closed the channel before responding.
> > This probably means the backend terminated abnormally before or while processing the request.
>
> Jose, please post problem reports to hackers, not to questions, on not-yet-released versions. I've moved
> this to hackers.
>
> btw, I saw this too but in a different context and wasn't certain if it was a new problem:
>
> postgres=> select char_length('hi'::text);
> length
> ------
> 2
> (1 row)
>
> postgres=> select character_length('hi'::varchar);
> PQexec() -- Request was sent to backend, but backend closed the channel before responding.
> This probably means the backend terminated abnormally before or while processing the request.
>
> - Tom
>
>
>

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1998-02-05 17:15:24 Re: [HACKERS] Preprocessor
Previous Message Ewan Mellor 1998-02-05 17:00:15 create function bug?