Pgscript : error creating a user with a variable as the password

From: plop plop <mr_weetos(at)hotmail(dot)com>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: Pgscript : error creating a user with a variable as the password
Date: 2012-03-16 13:23:46
Message-ID: DUB101-W123E979A919A56FAE0B252905F0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support


Hi all,

This is a problem about creating a user with a password thanks to a pgscript (pgadmin 1.14.1). I have searched a while around the internent, but I have found no solution so far.

The following script does not work ("error near « password»". Pgadmin is in French, so i do not know how the warning exactly looks like in English) :

declare @USER, @PASS;
set @USER='user';
set @PASS='password';

CREATE ROLE @USER LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE PASSWORD @PASS;

Whereas this one does :

declare @USER;

set @USER='user';

CREATE ROLE @USER LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE PASSWORD 'password';

What am I doing wrong with the @PASS variable ?

Thank you for your support, and congrats for what you do.

VP

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message MattK 2012-03-17 18:06:20 Server status hanging on OS X
Previous Message Vik Reykja 2012-03-16 09:25:20 Backup/Restore round-tripping