Re: Clarifying the ImportForeignSchema API

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clarifying the ImportForeignSchema API
Date: 2020-08-04 04:39:35
Message-ID: CAB8KJ=iJ7=QZGrSrg5tCuFK6G2gRHEe3zYc+nPrOmTb7W3wPqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2020年8月4日(火) 12:08 David Fetter <david(at)fetter(dot)org>:
>
> Folks,
>
> I noticed that the API document for IMPORT FOREIGN SCHEMA states in
> part:
>
> It should return a list of C strings, each of which must contain a
> CREATE FOREIGN TABLE command. These strings will be parsed and
> executed by the core server.
>
> A reasonable reading of the above is that it disallows statements
> other than CREATE FOREIGN TABLE, which seems overly restrictive for no
> reason I can discern. The list of C strings seems reasonable as a
> requirement, but I think it would be better to rephrase this along the
> lines of:
>
> It should return a list of C strings, each of which must contain a
> DDL command, for example CREATE FOREIGN TABLE. These strings will
> be parsed and executed by the core server in order to create the
> objects in the schema.
>
> as a foreign schema might need types (the case I ran across) or other
> database objects like CREATE EXTERNAL ROUTINE, when we dust off the
> implementation of that, to support it.

+1

A while back I was considering using IMPORT FOREIGN SCHEMA to import
object comments (which IMHO can be considered part of the schema) and was
puzzled by the above. I never pursued that further due to lack of
time/priorities;
IIRC technically it wouldn't have been an issue regardless of what the spec
may or may not say (I couldn't find anything at the time).

Regards

Ian Barwick

--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-08-04 04:42:37 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Hao Wu 2020-08-04 03:55:43 Rewrite view?