Re: Bad behaviour when inserting unspecified variable length datatypes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad behaviour when inserting unspecified variable length datatypes
Дата
Msg-id 6107.999547783@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bad behaviour when inserting unspecified variable length datatypes  (Dave Blasby <dblasby@refractions.net>)
Список pgsql-hackers
Dave Blasby <dblasby@refractions.net> writes:
> CREATE TABLE test_table (myint integer, mydata MY_DATATYPE);
> INSERT INTO test_table VALUES (1);

> At this point, I'd expect there to be one row in test table. The myint
> column will have the value one, and the mydata column will have the
> value NULL.

Check...

> This doesnt appear to be the case.  It seems that the mydata column will
> have a structure that looks like a '-'::TEXT structure (ie. the first 4
> bytes are an int representing 5, and the 5th byte is the ASCII '-').

Uh, what did your CREATE TYPE command look like, exactly?  This sounds
like you specified a default value for the datatype.

Maybe you need to show us your datatype's I/O functions, too.  Since
this works perfectly fine for the standard variable-length datatypes,
it's hard to arrive at any other conclusion than that your custom
datatype code is erroneous.  But there's not enough info here to figure
out just what is wrong with it.
        regards, tom lane


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

Предыдущее
От: "Colin 't Hart"
Дата:
Сообщение: Re: Porting to Native WindowsNT/2000
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: OpenFTS (Open Source Full Text Search engine) pre-announce