Re: IMPORT FOREIGN SCHEMA statement - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: IMPORT FOREIGN SCHEMA statement
Date
Msg-id 20140527142944.GK2556@tamriel.snowman.net
Whole thread Raw
In response to Re: IMPORT FOREIGN SCHEMA statement  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: IMPORT FOREIGN SCHEMA statement  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> Stephen Frost wrote:
> > > It seems like it would often be desirable for the Oracle FDW to smash
> > > all-upper-case names to all-lower-case while importing, so that no quoting
> > > is needed on either side.  I doubt though that this is so desirable that
> > > it should happen unconditionally.
> >
> > The oracle FDW would simply need a foreign-server level option which
> > says "smash everything to lowercase on import".
>
> That's not the same thing though -- consider what happens to the quoting
> needs for names with mixed case.  If you change mixed case to
> all-lowercase, references to such objects using quotes in the
> application code would fail because the name is now all-lowercase in
> Postgres.  A tri-valued enum could do the trick:
> lowercase_names={wholly_uppercase_only, all, none}
> with the first one being the most sensible and default.

Sure, I was being a bit over-simplistic.  As was mentioned up-thread,
the option would rather be "flip all-uppercase to lowercase and all-
lowercase to uppercase, quote any which are mixed", or something along
those lines.  What I was trying to get at is that it's up to the FDW
what options it wants to support in this regard and we already have a
way for the admin to pass in useful information to the FDW by way of the
FOREIGN SERVER FDW options.

This, plus the generic ability to pass an OPTIONS clause to the IMPORT
(allowing you to have different defaults for different IMPORT
statements) and having it be transactional, as you mention, appears to
be covering all the relevant bases.
Thanks,
    stephen

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: IMPORT FOREIGN SCHEMA statement
Next
From: Matteo Beccati
Date:
Subject: Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD