Re: REFERENCES error message complaint, suggestion

From: "Rod K" <rod(at)23net(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <weigelt(at)metux(dot)de>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: REFERENCES error message complaint, suggestion
Date: 2004-03-05 15:37:00
Message-ID: KNEPILBLIADCDMMPIKIKKECJEOAA.rod@23net.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

MySQL allows double quotes or single quotes around string literals. Back
ticks indicate identifiers.

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> Sent: Friday, March 05, 2004 10:12 AM
> To: weigelt(at)metux(dot)de
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] REFERENCES error message complaint, suggestion
>
>
> Enrico Weigelt <weigelt(at)metux(dot)de> writes:
> > * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [2004-03-04 11:24:11 -0500]:
> >> Double quotes are for names (identifiers). Single quotes are
> >> for string literals (constants).
>
> > BTW: is this general SQL syntax or just PostgeSQL ?
>
> This is SQL92 standard behavior. Relevant extracts from the standard:
>
> <delimited identifier> ::=
> <double quote> <delimited identifier body> <double quote>
>
> <character string literal> ::=
> [ <introducer><character set specification> ]
> <quote> [ <character representation>... ] <quote>
> [ { <separator>... <quote> [ <character
> representation>... ] <quote> }... ]
>
> <double quote> ::= "
>
> <quote> ::= '
>
> > mysql does no distinction (which is IMHO very unclean),
>
> How can they have no distinction? Suppose I write
>
> select 'col' from tab;
> select "col" from tab;
>
> If there is a column tab.col, what am I going to get in each case?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2004-03-05 15:50:29 PHP on slackware
Previous Message Tom Lane 2004-03-05 15:18:29 Re: relocatable binary distribution