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

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

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

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