[Pdx-pm] (OT) SQL style question
david at kineticode.com
Thu Jan 13 14:29:39 PST 2005
On Jan 13, 2005, at 2:15 PM, Austin Schutz wrote:
> This scares me. I'm not sure if it's portable, but it will
> _definitely_ bite you when someone forgets the "s.
I believe that double-quotes are the SQL-standard way of using
non-standard character in entity names in a database. So it should be
> I've never even
> seen this done before.. what happens when you join something with the
> view and need to specify a column? SELECT some_view."other_table.id" ?
Yes, that's exactly what you do.
> I don't know of any alternatives, but I'd be interested to know
> if there were.
Me, too! I know that there are other characters you can use, but your
options are limited. Allowed characters generally only allow a-zA-Z_
(I'd kill to be able to use "-", but it's not to be). But there is
variation. PostgreSQL, for example, allows you to use "$". But this
would be confusing to me:
...especially since $ means something in both Perl and PostgreSQL
functions. PostgreSQL also allows the use of Unicode characters over a
certain number. So, for example, I could do:
But the trouble with these solutions is that neither of them is very
I kind of like the dot notation, as it means exactly what it
represents: A reference to another column in another table.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2369 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20050113/b236eb8b/smime.bin
More information about the Pdx-pm-list