Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR
Date
Msg-id m0y0UZ5-000BFRC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Responses Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
>
> Jan Wieck wrote:
>
> > > [... quoting level exceeded ...]
> >
> >     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?
>
> It should allow any length (up to the implementation maximum of 4096). The usage is not defined for SQL92,
> unlike the case for "char" with no explicit size which defaults to one.
>

    Could be hacked into varcharin(). If the test on atttypmod is
    changed from "!= -1" into "> 0" it  works  that  way.   Don't
    have  the  time  right now to run a regression test, but some
    typed queries with

    select into t values ...

    and

    select into t select ...

    worked O.K.


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 by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Re: [QUESTIONS] impossible insert data into VARCHAR
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Hi