CREATE USER through SQL possible?
CREATE USER through SQL possible?
От:
"Adams, Joe" <jadams1@mtt.ca>
Дата:
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
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
$ADDstatement
";
}
Has anyone done this before? If so I could use some guidence because I can't
seem to get it working.
Joe Adams