Re: Typed tables - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Typed tables
Date
Msg-id 4B4CB852.8030200@joeconway.com
Whole thread Raw
In response to Re: Typed tables  (Andrew Chernow <ac@esilo.com>)
List 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



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: NOT NULL violation and error-message
Next
From: Bruce Momjian
Date:
Subject: Re: damage control mode