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

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Single quotes vs. double quotes when setting a pwd and other cmds
Date: 2010-06-23 09:16:04
Message-ID: 20100623091603.GJ4289@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Alexander Farber :
> 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 ' for variable strings (values), and " for identifier (table-name,
column-name).

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Deven 2010-06-23 09:16:26 Re: Facing Problem in Autovacuuming Deamon....
Previous Message Pavel Stehule 2010-06-23 09:11:21 Re: Single quotes vs. double quotes when setting a pwd and other cmds