CREATE USER possible?

From: "Adams, Joe" <jadams1(at)mtt(dot)ca>
To: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: CREATE USER possible?
Date: 2000-08-15 20:17:11
Message-ID: ED7A447524CCD311A9BF009027DC86ED011417C8@NSEXCH02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I am trying to make a administration web page for postgreSQL users. The main
purpose of this web page is to add , remove and modify pgsql users. To do
this I am connecting to a database under the postgres user. The following is
only some of the code being used.

$dataSource="dbi:Pg:dbname=alidb";
$dbh = DBI->connect($dataSource, "postgres", "password");
if($dbh)
{
$statement = "CREATE USER oadd WITH PASSWORD rspassword";
#prepare and execute the statment
$sth = $dbh->prepare($statement);
$rc = $sth->execute;
print "USER HAS BEEN ADDED<br>$ADDstatement<br>";
}

From what I understand and from talking to some people on #postgresql it
doesn't matter what DB I connect to, just that the user I connect with has
the rights to create other users.
I've looked for this topic in previous threads and am somewhat confused. Is
what I'm doing the correct approach. If not what would be the right approach
(ie running ./createuser ).

Someone else must have already written this - - so I'd love to hear from
you.

Browse pgsql-admin by date

  From Date Subject
Next Message Ken Kinder 2000-08-15 21:19:42 schema diagram
Previous Message Geoffrey Gifford 2000-08-15 16:17:22 DBI & DBD-Pg