Skip site navigation (1) Skip section navigation (2)

Re: Behaviour of rows containg not-null domains in plpgsql

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Postgresql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Behaviour of rows containg not-null domains in plpgsql
Date: 2008-02-24 17:38:19
Message-ID: 47C1AB8B.1030802@phlo.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Andrew Dunstan wrote:
> Florian G. Pflug wrote:
>> If you define a domain over some existing type, constrain it to 
>> non-null values, and use that domain as a field type in a table 
>> definition, it seems to be impossible to declare pl/pgsql variables
>>  of that table's row type. The problem seems to be that upon
>> declaration, the row variable is filled with nulls - but since the
>> domain is marked not-null, that immediatly triggers an exception.
>> 
>> Here is an example <snipped example>

> What seems worse is that it still fails even if you declare the
> domain to have a default value.
I didn't try that, but I *did* try was providing a default value for the
row variable - which doesn't work either, since we do not currently
support row variable defaults.

The only workaround I found was to define the variable as "record".

regards, Florian Pflug


In response to

pgsql-hackers by date

Next:From: Joshua D. DrakeDate: 2008-02-24 17:40:11
Subject: Re: 8.3 / 8.2.6 restore comparison
Previous:From: Tom LaneDate: 2008-02-24 17:32:31
Subject: Re: 8.3 / 8.2.6 restore comparison

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group