Re: Single quotes vs. double quotes when setting a pwd and other cmds

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Single quotes vs. double quotes when setting a pwd and other cmds
Дата
Msg-id 4C21CF80.7000501@lelarge.info
обсуждение исходный текст
Ответ на Single quotes vs. double quotes when setting a pwd and other cmds  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
Le 23/06/2010 11:03, Alexander Farber a écrit :
> 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.
>

Use double quotes for identifiers, and single quotes for string values.

The password is a string, so you use single quotes with it. The username
is an identifier, so you (can) use double quotes with it.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Single quotes vs. double quotes when setting a pwd and other cmds
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Single quotes vs. double quotes when setting a pwd and other cmds