Re: query can't merge into table of the other schema - Mailing list pgsql-admin

From Tom Lane
Subject Re: query can't merge into table of the other schema
Date
Msg-id 12036.1541630162@sss.pgh.pa.us
Whole thread Raw
In response to Re: query can't merge into table of the other schema  (Ron <ronljohnsonjr@gmail.com>)
Responses Re: query can't merge into table of the other schema  (Pepe TD Vo <pepevo@yahoo.com>)
List pgsql-admin
Ron <ronljohnsonjr@gmail.com> writes:
> On 11/07/2018 09:10 AM, Pepe TD Vo wrote:
>> *ERROR: "cidrdba.sc_date_in" is not a known variable*

> That doesn't look like a "can't merge table from another schema" error.

>> *LINE 13:    MERGE INTO cidrdba.sc_date_in prod*
>> *               ^*
>> *SQL state: 42601*
>> *Character: 352*

> What happens when you run the statement through psql?

It will fail, of course, since there's no MERGE statement in Postgres.

I think the reason for the weird error is that the plpgsql scanner is
seeing the "INTO cidrdba.sc_date_in" part and trying to process that
as an "INTO plpgsql-variable" clause, before it's fed the rest of the
statement to the core parser, which is what would notice that MERGE
isn't a known command.  Maybe we could improve matters by reordering
that processing, but it might be a lot of work for a small benefit.

            regards, tom lane


pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: query can't merge into table of the other schema
Next
From: Pepe TD Vo
Date:
Subject: Re: query can't merge into table of the other schema