Re: [BUGS] [Resend: Domains and function] - Mailing list pgsql-hackers

From elein
Subject Re: [BUGS] [Resend: Domains and function]
Date
Msg-id 20040220095527.X25537@cookie.varlena.com
Whole thread Raw
In response to Re: [BUGS] [Resend: Domains and function]  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@users.sourceforge.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@postgresql.org)


pgsql-hackers by date:

Previous
From: "Ramanujam H S Iyengar"
Date:
Subject: ExecReScan function
Next
From: Robert Treat
Date:
Subject: Re: [PATCHES] NO WAIT ...