ERROR: domain domain1 does not allow null values - Mailing list pgsql-general

From Юдыцкий Игорь Владиславович
Subject ERROR: domain domain1 does not allow null values
Date
Msg-id 465EA28C.3090003@gw.tander.ru
Whole thread Raw
List pgsql-general
Hello.
I've found unexpected behavior of PostgreSQL 8.2.3

CREATE DOMAIN "public"."domain1" AS integer NOT NULL;

CREATE TABLE "public"."table1" ("field1" "public"."domain1") WITH OIDS;

CREATE OR REPLACE FUNCTION "public"."function1" () RETURNS text AS
$body$
declare
  a public.table1%ROWTYPE;
begin
  return 'test';
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

Result:
ERROR:  domain domain1 does not allow null values
CONTEXT:  PL/pgSQL function "function1" line 3 at block variables
initialization

I think it is insane.
Any comments wellcome...

pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: table partitioning pl/pgsql helpers
Next
From: Dudás József
Date:
Subject: Re: invalid memory alloc after insert with c trigger function