Re: FDW for PostgreSQL

From: Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FDW for PostgreSQL
Date: 2013-02-17 04:28:47
Message-ID: CAEZqfEcTHwN4Vp90fOeTQF=LD5gLNEM+ayR8MFTxzCGqwEg+xA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 17, 2013 at 8:44 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Continuing to look at this patch ... I'm wondering if any particular
> discussion went into choosing the FDW option names "nspname", "relname",
> and "colname".

IIRC, there was no deep discussion about those option names. I simply
chose "relname" and "nspname" from pg_class and pg_namespace. At that
time I thought users would understand those options easily if those
names are used in catalog.

> These don't seem to me like names that we ought to be
> exposing at the SQL command level. Why not just "schema", "table",
> "column"? Or perhaps "schema_name", "table_name", "column_name" if you
> feel it's essential to distinguish that these are names.

I think not-shortened names (words used in documents of conversations)
are better now. I prefer "table_name" to "table", because it would be
easy to distinguish as name, even if we add new options like
"table_foo".

Besides, I found a strange(?) behavior in psql \d+ command in
no-postfix case, though it wouldn't be a serious problem.

In psql \d+ result for postgres_fdw foreign tables, "table" and
"column" are quoted, but "schema" is not. Is this behavior of
quote_ident() intentional?

postgres=# \d+ pgbench1_branches
Foreign table
"public.pgbench1_branches"
Column | Type | Modifiers | FDW Options | Storage |
Stats target | Description
----------+---------------+-----------+------------------+----------+--------------+-------------
bid | integer | not null | ("column" 'bid') | plain |
|
bbalance | integer | | | plain |
|
filler | character(88) | | | extended |
|
Server: pgbench1
FDW Options: (schema 'public', "table" 'foo')
Has OIDs: no

We can use "table" and "column" options without quoting (or with quote
of course) in CREATE/ALTER FOREIGN TABLE commands, so this is not a
barrier against choosing no-postfix names.

--
Shigeru HANADA

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2013-02-17 05:46:54 Re: PATCH: Split stats file per database WAS: autovacuum stress-testing our system
Previous Message David E. Wheeler 2013-02-17 00:50:08 Re: JSON Function Bike Shedding