Re: Single quotes vs. double quotes when setting a pwd and other cmds - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Single quotes vs. double quotes when setting a pwd and other cmds
Date
Msg-id AANLkTikn5Ebtt3XREhzweGv_rzCZT3QFhVuuD8chusbO@mail.gmail.com
Whole thread Raw
In response to Single quotes vs. double quotes when setting a pwd and other cmds  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
Hello

ANSI SQL uses double quotes only for SQL identifiers. For literals are
used single quotes.

like

SELECT col AS "some strange sql column identifier", 'some string
value' FROM "some strange sql table identifier"

so for case sensitive or strange (is keyword, contains space) sql
identifiers use double quotes, for string constants use single quotes.

some other database uses [] or ` .

Regards
Pavel


2010/6/23 Alexander Farber <alexander.farber@gmail.com>:
> Hello,
>
> why aren't double quotes accepted below?
>
> db1=# alter user user1 password "pass1";
> ERROR:  syntax error at or near ""pass1""
> LINE 1: alter user user1 password "pass1";
>                                 ^
> db1=# alter user user1 password 'pass1';
> ALTER ROLE
>
> Is there a thumb rule to know when to use which quotes?
> I'm often confused by them when using psql.
>
> Thank you
> Alex
>
> PS: Using postgresql-server-8.3.6 @ OpenBSD 4.5
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Single quotes vs. double quotes when setting a pwd and other cmds
Next
From: "A. Kretschmer"
Date:
Subject: Re: Single quotes vs. double quotes when setting a pwd and other cmds