Strangeness/bug when working with my own datatype in PostgreSQL - Mailing list pgsql-bugs

From Солодовников Константин
Subject Strangeness/bug when working with my own datatype in PostgreSQL
Date
Msg-id D078291436B0D411B08800805F6D131501E55D@fantom.tcnet.ru
Whole thread Raw
Responses Re: Strangeness/bug when working with my own datatype in PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Good time of day!

I've got some strangeness/bug when working with my own datatype in
PostgreSQL.
Here's a short description of the sitiation:

I've developed a 1-byte integer datatype (let's call it "int1").
The input and output functions for this datatype I wrote myself.

Everything works just fine except for the following:

I create a table "test_int1" with two columns "i4" and "i1" of type "int4"
and "int1" respectively.
When I insert a new row into this table without providing a value for the
"i1" column, I get a value of "45" in it.
The column doesn't have any default values. Neither it has "not null" option
set.
If I explicitly provide a NULL value for this column in an insertion
statement, I get what I expect - a NULL value for the column.
Not-supplying a value for any original PGSQL datatype (say, "int4") also
makes it correctly - I see a NULL value.

Any comments/suggestions?
I have PostgreSQL 7.0.3 on FreeBSD 4.2-STABLE.

Best regards.

Konstantin Solodovnikov.


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Lock Detection (was: pg_dump failing on LinuxPPC)
Next
From: Tom Lane
Date:
Subject: Re: Strangeness/bug when working with my own datatype in PostgreSQL