CREATE USER possible?

Поиск
Список
Период
Сортировка
От Adams, Joe
Тема CREATE USER possible?
Дата
Msg-id ED7A447524CCD311A9BF009027DC86ED011417C8@NSEXCH02
обсуждение исходный текст
Список 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.


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Geoffrey Gifford"
Дата:
Сообщение: DBI & DBD-Pg
Следующее
От: "Rob Stoddard"
Дата:
Сообщение: Suffering