Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux