Re: Typed table DDL loose ends

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: Typed table DDL loose ends
Date: 2011-04-18 15:33:47
Message-ID: 22827.1303140827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Apr 18, 2011 at 10:48 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:
>> FWIW, the term "stand-alone composite type" appears twice in our documentation.

> Hmm, OK. Anyone else have an opinion on the relative merits of:

> ERROR: type stuff is not a composite type
> vs.
> ERROR: type stuff is not a stand-alone composite type

> The intent of adding "stand-alone" was, I believe, to clarify that it
> has to be a CREATE TYPE stuff AS ... type, not just a row type (that
> is, naturally, composite, in some less-pure sense). I'm not sure
> whether the extra word actually makes it more clear, though.

In 99.9% of the code and docs, a table rowtype is a perfectly good
composite type. I agree with Noah that just saying "composite type"
is inadequate here; but I'm not sure that "stand-alone" is a helpful
adjective either. What about inverting the message phrasing, ie

ERROR: type stuff must not be a table's row type

You might need some extra logic to keep on giving "is not a composite
type" in cases where it's not composite at all. But this is enough of a
departure from our usual behavior that I think the error message had
better be pretty darn clear.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-04-18 15:35:05 Re: Typed table DDL loose ends
Previous Message Tom Lane 2011-04-18 15:25:44 Re: [JDBC] JDBC connections to 9.1