Re: [HACKERS] [Resend: Domains and function]

From: elein <elein(at)varlena(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, elein <elein(at)varlena(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [HACKERS] [Resend: Domains and function]
Date: 2004-02-20 17:55:27
Message-ID: 20040220095527.X25537@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The reason it is a bug rather than an unimplemented feature
is that it pokes a hole in the effectiveness of domains.
What good is a domain if it cannot be enforced everywhere
you use it? That is like having a hole in referential
integrity. (Though I admit not many people will run into
this until more people use domains.)

Shouldn't all function calls go (through fast path or fmgr
or the language manager?) to a centralized parameter marshalling?
They should. The informix reimplementation of postgres was
very firm about this. It ensured parameter coersion consistency
across all languages.

Centralizing the parameter marshalling will make it so
much easier to implement things like domains and
arrays in various languages consistently and across
the board. Once the coersion it properly done in SQL,
then each language can decide the natural form for
the standard data types or punt to text.

elein

On Fri, Feb 20, 2004 at 11:33:39AM -0500, Tom Lane wrote:
> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> > so ISTM that your example is certainly a deficiency if not a bug.
>
> I believe it is a bug or at least an unimplemented feature in plpgsql:
> plpgsql has its own implementation of casting, and is not aware that
> casting to a domain should involve running check constraints.
>
> The same might be true of the other PL languages, not sure.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-02-20 18:03:08 Re: [HACKERS] [Resend: Domains and function]
Previous Message Tom Lane 2004-02-20 16:33:39 Re: [HACKERS] [Resend: Domains and function]

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-02-20 18:03:08 Re: [HACKERS] [Resend: Domains and function]
Previous Message Tom Lane 2004-02-20 16:33:39 Re: [HACKERS] [Resend: Domains and function]