Re: Create User - Mailing list pgsql-general

From Neil Conway
Subject Re: Create User
Date
Msg-id 1137769797.9330.8.camel@localhost.localdomain
Whole thread Raw
In response to Create User  (DB Subscriptions <db.subscriptions@shepherdhill.biz>)
List pgsql-general
On Fri, 2006-01-20 at 09:16 +0100, DB Subscriptions wrote:
> BEGIN
>     CREATE USER NEW.userid WITH PASSWORD NEW.pword IN GROUP NEW.groupe;
>
>     RETURN new;
> END;

You can't use PL/PgSQL variables in DDL commands. Try using EXECUTE:

EXECUTE 'CREATE USER ' || NEW.userid || '...';

-Neil



pgsql-general by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: autovacuum and temporary tables
Next
From: Csaba Nagy
Date:
Subject: Re: autovacuum and temporary tables