Re: Typed tables

From: Joe Conway <mail(at)joeconway(dot)com>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Typed tables
Date: 2010-01-12 17:58:42
Message-ID: 4B4CB852.8030200@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/12/2010 06:43 AM, Andrew Chernow wrote:
>>
>> What is the point of this discussion? We're not going to remove the
>> facility for composite types, regardless of whether or not some people
>> regard them as unnecessary. And "a name that better suits the task" is
>> not to be sneered at anyway.
>>
>
> I never asked for anything to be removed nor do I sneer :) Honestly, I
> was only trying to understand why it existed.

It exists because once upon a time when SRFs were first created, and you
were using a function returning SETOF RECORD, you would either have to
enumerate every column definition in your query, or create a "dummy"
table that had the right columns/types to match your return tuple.

That solution was generally viewed as grotty -- the former is a lot of
typing and clutter, and the latter creates a table with the only purpose
being to get the needed composite type created. Therefore we added the
ability to skip the table creation and just produce the needed composite
type.

HTH

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2010-01-12 17:58:48 Re: damage control mode
Previous Message Kevin Grittner 2010-01-12 17:58:16 Re: NOT NULL violation and error-message