Re: comparing NEW and OLD (any good this way?) - Mailing list pgsql-general

From Daniel Verite
Subject Re: comparing NEW and OLD (any good this way?)
Date
Msg-id 7781715e-7540-4a24-943e-2ab616cc0048@mm
Whole thread Raw
In response to Re: comparing NEW and OLD (any good this way?)  (Sam Mason <sam@samason.me.uk>)
List 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

pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: comparing NEW and OLD (any good this way?)
Next
From: Harald Fuchs
Date:
Subject: Re: Generating random unique alphanumeric IDs