Re: IMPORT FOREIGN SCHEMA can't be run in in pl/pgsql due to INTO

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: IMPORT FOREIGN SCHEMA can't be run in in pl/pgsql due to INTO
Date: 2016-07-11 20:09:27
Message-ID: 511.1468267767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> Currently pl/pgsql interprets the mandatory INTO of IMPORT FOREIGN
> SCHEMA as INTO variable.

Ugh, that's definitely a bug.

> I estimate this to be minor oversight in
> pl/pgsql parsing with respect to the introduction of this statement.

While we can certainly hack it by something along the lines of not
recognizing INTO when the first token was IMPORT, the whole thing
seems awfully messy and fragile. And it will certainly break again
the next time somebody decides that INTO is le mot juste in some new
SQL command. I wish we could think of a safer, more future-proof
solution. I have no idea what that would be, though, short of
deprecating INTO altogether.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emre Hasegeli 2016-07-11 20:25:16 Re: GiST index build versus NaN coordinates
Previous Message Merlin Moncure 2016-07-11 19:14:16 IMPORT FOREIGN SCHEMA can't be run in in pl/pgsql due to INTO