Re: Patch for 8.5, transformationHook - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Patch for 8.5, transformationHook
Date
Msg-id 20090809050541.GD9155@alvh.no-ip.org
Whole thread Raw
In response to Re: Patch for 8.5, transformationHook  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Patch for 8.5, transformationHook  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Jeff Davis escribió:
> On Mon, 2009-04-20 at 18:53 +0200, Pavel Stehule wrote:
> > b) it allows constructors for data types (ANSI SQL)
> > 
> > datatype(typefield1[, typefiedl2[, typefiedl3[, ...]]]) returns type
> 
> Can you describe this case in more detail? What section of SQL are you
> referring to?

Hmm, I see them in 4.7 "user-defined types".  However what's in SQL2003
and the 2008 draft I have is:

3.1.6.6 constructor function: A niladic SQL-invoked function of which exactly
one is implicitly specified for every structured type. An invocation of the
constructor function for data type T returns a value V of the most specific
type T such that V is not null and, for every observer function O defined for
T, the invocation O(V) returns the default value of the attribute corresponding
to O.

and later:

4.7.4 Constructors
Associated with each structured type ST is one implicitly defined constructor
function, if and only if ST is instantiable.
Let TN be the name of a structured type T. The signature of the constructor
function for T is TN() and its result data type is T. The invocation TN()
returns a value V such that V is not null and, for every attribute A of T, A(V)
returns the default value of A. The most specific type of V is T.
For every structured type ST that is instantiable, zero or more SQL-invoked
constructor methods can be specified.  The names of those methods shall be
equivalent to the name of the type for which they are specified.


So I'm not seeing those typefields anywhere.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: join removal
Next
From: daveg
Date:
Subject: Re: Alpha releases: How to tag