Subject Domains in PSQL - constraints
Author Adriano dos Santos Fernandes
Hi!

When we discussed domains usage in PSQL we go to implement only data
type support (TYPE OF) without default value and constraints.

The trick problem was with constraints and output parameters.

I see very unintuitive to need to declare default value for output
parameters in case the domain is not-nullable and don't have a default,
in more or less this way:
create procedure sp returns (o dom = 1)
as
begin
end

So I propose we defer variables/parameters constraints to first read,
but of course checking in assignments too.

So you'll get an error if you read a not-nullable variable/parameter
that is null or try to assign null to it, but don't get error if you
declare and not use it.

For output parameters, you get error if you try to exit/suspend the
procedure with nulls on output parameters.

Comments?


Adriano