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

Поиск
Список
Период
Сортировка
От jwieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR
Дата
Msg-id m0y0Tok-000BFRC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на Re: [QUESTIONS] impossible insert data into VARCHAR  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
Hi,

>
> > 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

    ARRRRG - then next problem with VARSIZE - damn thing.

    This  time  it's during the parser (gdb told me). varcharin()
    is called with a atttypmod of  0  causing  a  palloc()  of  0
    bytes.  How should a VARCHAR type whithout a specified length
    behave? Is this type 1 character or a  variable  size  up  to
    4096?


Until later, Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

В списке pgsql-hackers по дате отправления:

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] PL code and fmgr_addr
Следующее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Bug?