Re: DEFAULT of domain ignored in plpgsql (8.4.1)

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgresql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DEFAULT of domain ignored in plpgsql (8.4.1)
Date: 2009-11-21 01:56:36
Message-ID: 4B0748D4.7070601@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Would a patch that changes that have any chance of being accepted? Or is
> the gain (not having to repeat the DEFAULT clause, and being able to
> maintain it at one place instead of many) considered too small compared
> to the risk of breaking existing code?

I don't think there's a lot of risk of code breakage; few people use
domains, fewer use them with defaults, and you might be the only one
using them as variable types. And there are going to be more
substantial backwards compat issues with the lexer changes anyway. As
long as we remember to flag the compatibility issue in the release
notes, I don't see it as a problem.

However, there are some other issues to be resolved:

(1) what should be the interaction of DEFAULT parameters and domains
with defaults?

(2) this change, while very useful, does change what had been a simple
rule ("All variables are NULL unless specifically set otherwise") into a
conditional one ("All variables are NULL unless set otherwise OR unless
they are declared as domain types with defaults"). Do people feel that
the new behavior would be sufficiently intuitive to avoid user confusion?

(3) Last I checked, there were still several places in which domains did
not behave consistently in stored procedures. I think that Elein had
some unfinished patches in this regard -- you'll want to search the
archives and the TODO list.

--Josh Berkus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2009-11-21 02:25:42 Re: [HACKERS] pgsql: /home/peter/commit-msg
Previous Message Emmanuel Cecchet 2009-11-21 00:32:58 Re: Partitioning option for COPY