Re: avoid MERGE_ACTION keyword?

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: avoid MERGE_ACTION keyword?
Date: 2024-05-17 08:13:22
Message-ID: CAEZATCXHCHOfmSSwQTpPYNmiTZLQbYOO3u+1HNZ0maOf6+1wiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 16 May 2024 at 15:15, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> I wonder if we can avoid making MERGE_ACTION a keyword.
>

Yeah, there was a lot of back and forth on this point on the original
thread, and I'm still not sure which approach is best.

> I think we could parse it initially as a function and then transform it
> to a more special node later. In the attached patch, I'm doing this in
> parse analysis. We could try to do it even later and actually execute
> it as a function, if we could get the proper context passed into it somehow.
>

Whichever way it's done, I do think it's preferable to have the parse
analysis check, to ensure that it's being used in the right part of
the query, rather than leaving that to plan/execution time.

If it is turned into a function, the patch also needs to update the
ruleutils code --- it needs to be prepared to output a
schema-qualified function name, if necessary (something that the
keyword approach saves us from).

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-05-17 08:15:39 Re: commitfest.postgresql.org is no longer fit for purpose
Previous Message Daniel Gustafsson 2024-05-17 07:58:59 Re: Minor cleanups in the SSL tests