table_name syntax

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Thu Apr 30 14:56:48 CEST 2015


Dear DAL,

Sorry for the two related mails, but I'd like to keep the discussion
on discouraging delimited identifiers separate of the question of how
to sanely deal with them since we can't outlaw them, as well as any
raw_*_names.

On Tue, Apr 28, 2015 at 04:26:19PM +0100, Dave Morris wrote:
> Comments inline ..
> 
> On 2015-04-28 08:14, Markus Demleitner wrote:
> >
> >[.. Lots of permuatations of putting quotes in various places ...]
> >
> >>Which makes it hard to search for table names that start with a specific
> >>pattern,
> >>
> >>    SELECT .. WHERE schema_name = 'twomass' AND table_name LIKE 'ps%'
> >>
> >>would only match one of the possible combinations.
> >
> >True.  And IMHO a strong suggestions we should discourage the use of
> >delimited identifiers in general and in table names in particular.
> >And then essentially say: "If you absolutely must have them, this is
> >what to do".  Which would include: Always use regular identifiers in
> >lower case (i.e., in particular: no quotes in the literals) unless
> >you absolutely have no choice, in which chase put quotes around all
> >literals, including quoting inner quotes.
> >
> 
> "The following section describes aspects of the language that the authors of
> this document would prefer you not to use" - !?

Well, standards describing practices that should be avoided unless
there's no choice are quite common, aren't they?  In particular in
this case, when we're building on a standard that's great but also
widely regarded as being unnecessarily painful in some
places[citation needed].

> One of our biggest data providers has a huge number of tables and columns,
> almost all of which will need quoted identifiers.

True -- we put them in  to cater for emergencies and odd cases.
VizieR is, in the whole VO, a unique case, which can already be seen
from the fact that we had to adapt VOSI tables for them.  I'm sure
there is no other service with that amount of legacy practices
directly influencing a possible TAP interfaces.  So, exactly because
they're so singular they can pull a "we have to use delimited
identifiers" with a lot of justification.

But of course in some corner of the standard we can say something
along the lines of: "When you build a new system or update an old
one, *don't* follow them in this respect.  They didn't have a choice,
you, howerver have, and use that freedom wisely.  Incidentially, the
wise thing to do is not to rely on delimited identifiers."

No?


Cheers,

       Markus



More information about the dal mailing list