Re: comparing NEW and OLD (any good this way?)

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: comparing NEW and OLD (any good this way?)
Date: 2009-08-17 13:59:36
Message-ID: 7781715e-7540-4a24-943e-2ab616cc0048@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sam Mason wrote:

> > CREATE FUNCTION test() returns void as $$
> > declare
> > r our_table;
> > begin
> > r:=null;
> > end;
> > $$ LANGUAGE plpgsql;
> >
> > SELECT test() yields:
> > ERROR: cannot assign non-composite value to a row variable
> > CONTEXT: PL/pgSQL function "test" line 4 at assignment
>
> This just looks like PG missing a feature. plpgsql has much less user
> and developer time spent on it, so I'd expect to find more strangeness
> in darker corners like this.

Actually if I had written r:=null::our_table then this would have worked,
which negates the point I was trying to make. I'm not sure if it's an
oversight of plpgsql that null by itself is not accepted in this context, but
anyway my idea that it had something to do with a conceptual problem was
wrong.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harald Fuchs 2009-08-17 14:00:54 Re: Generating random unique alphanumeric IDs
Previous Message Daniel Verite 2009-08-17 13:45:02 Re: comparing NEW and OLD (any good this way?)