Re: problems selecting from altered table - Mailing list pgsql-general

From Richard Huxton
Subject Re: problems selecting from altered table
Date
Msg-id 467805ED.3020207@archonet.com
Whole thread Raw
In response to Re: problems selecting from altered table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Richard Huxton <dev@archonet.com> writes:
>> Any developers care to comment?
>
> plpgsql isn't very bright about tuple descriptors containing dropped
> columns.  The immediate problem is that compatible_tupdesc() doesn't
> think a tupdesc containing one column matches one containing the same
> column plus a dropped column; but fixing that would just allow
> subsequent processing to crash :-(.  It needs a fair amount of work.
> I think the other PLs are no better.

OK, I think (after a bit of playing) I see what you mean.

If I do the following:
   CREATE TYPE tt AS (id int);
   CREATE OR REPLACE FUNCTION sel_test2() RETURNS tt AS $$
   ...

Then it all works OK, because the SELECT inside the function is
returning one int and so is the function.

--
   Richard Huxton
   Archonet Ltd


pgsql-general by date:

Previous
From: Noah Heusser
Date:
Subject: Re: Dynamic Log tigger (plpgsql)
Next
From: "Jeffrey Webster"
Date:
Subject: Re: initdb