table_name syntax

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Tue Apr 28 11:52:57 CEST 2015


Hi,

On Tue, Apr 28, 2015 at 10:43:41AM +0100, Mark Taylor wrote:
> However, I didn't get an explicit answer to this:
> 
> On Mon, 27 Apr 2015, Mark Taylor wrote:
> 
> > (b) what is the rule for other TAP_SCHEMA columns like
> > schema_name and column_name (and others?)?  Quoting these columns
> > would be unnecessary (since there is no possibility of delimited
> > parts in this case), but it would seem inconsistent to require
> > quoting for some of these metadata columns and not others;
> > at least it should be documented explicitly.
> 
> I get the sense from Pat's reply that the answer to that is
> that column_name and schema_name must not be quoted in the
> TAP_SCHEMA tables, but some of the other replies in this
> thread (e.g. Dave's raw_schema_name suggestion) seem to suppose
> otherwise, so I'm not sure.

I'd fairly strongly suggest that all DB names should be in a form
ready for usage.  While the case:

>    +-------------------+-------------+
>    | table_name        | column_name |
>    +-------------------+-------------+
>    | B/avo.rad/catalog | Sp-Index    |
>    +-------------------+-------------+
> 

might conceivably be caugt by clients who might themselves see that
Sp-Index simply cannot be a delimited identifier, this is impossible
for a column_name 'FooBar' -- this might work as a regular identifier,
but *if* it's a delimited identifer, only '"FooBar"' will work.

So:

> I take from this discussion that it should instead return:
> 
>    +---------------------+-------------+
>    | table_name          | column_name |
>    +---------------------+-------------+
>    | "B/avo.rad/catalog" | Sp-Index    |
>    +---------------------+-------------+
> 
> Should it in fact return:
> 
>    +---------------------+-------------+
>    | table_name          | column_name |
>    +---------------------+-------------+
>    | "B/avo.rad/catalog" | "Sp-Index"  |
>    +---------------------+-------------+
> 
> ?

I'm all for option 2, otherwise query builders will have to guess,
and:

  $ python -c "import this" | grep guess
  In the face of ambiguity, refuse the temptation to guess.

Cheers,

        Markus



More information about the dal mailing list