Re: Patch for 8.5, transformationHook

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Patch for 8.5, transformationHook
Date: 2009-08-09 05:05:41
Message-ID: 20090809050541.GD9155@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message daveg 2009-08-09 05:06:55 Re: Alpha releases: How to tag
Previous Message Robert Haas 2009-08-09 03:33:57 Re: join removal