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

Re: PLs and domain constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PLs and domain constraints
Date: 2005-12-23 23:38:39
Message-ID: 10454.1135381119@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Neil Conway <neilc(at)samurai(dot)com> writes:
> For #2, I'm not sure where the right place to check domain constraints 
> is. I was thinking about adding the check to the fmgr function call 
> logic[1], but the domain checking code needs an ExprContext in which to 
> evaluate the constraint, which wouldn't easily be accessible.

I'd go with making the PLs do it.  fmgr is a very low logical level and
it's inappropriate for it to even know what a domain is.  As an example
of the problems you will run into: how is fmgr going to find out whether
the target type is a domain, much less what its constraints are?  It
can't assume that it's running inside a transaction, or even that the
system catalog access machinery is alive yet.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2005-12-23 23:58:22
Subject: Re: [PATCHES] default resource limits
Previous:From: Neil ConwayDate: 2005-12-23 23:28:10
Subject: PLs and domain constraints

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