Re: Adding OLD/NEW support to RETURNING

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Tomas Vondra <tomas@vondra.me>
Date: 2024-10-14T11:03:06Z
Lists: pgsql-hackers

Attachments

> > typedef struct ReturningOption
> > {
> >     NodeTag        type;
> >     bool        isNew;
> >     char       *name;
> >     int            location;
> > } ReturningOption;

Thinking about that struct some more, I think "isNew" is better done
as an enum, since this is meant to be a generic option. So even though
it might never have more than 2 possible values, I think it's neater
done that way.

Regards,
Dean

Commits

  1. doc: Updates for RETURNING OLD/NEW.

  2. Fix parsing of qualified relation names in RETURNING.

  3. Add OLD/NEW support to RETURNING in DML queries.

  4. Remove useless casts to (void *)

  5. Refactor/reword some error messages to avoid duplicates