Re: Restrict allowed database names?

Поиск
Список
Период
Сортировка
Искать
От
Scott Mead
Тема
Re: Restrict allowed database names?
Дата
Msg-id
d3ab2ec81003201801k20749cf9n7cabddc4b2ebe94@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Restrict allowed database names? Adam Seering <aseering@MIT.EDU>
Re: Restrict allowed database names? Steve Atkins <steve@blighty.com>
Re: Restrict allowed database names? Sergey Konoplev <gray.ru@gmail.com>
Re: Restrict allowed database names? "Daniel Verite" <daniel@manitou-mail.org>
Re: Restrict allowed database names? Tom Lane <tgl@sss.pgh.pa.us>
Re: Restrict allowed database names? Sergey Konoplev <gray.ru@gmail.com>
Re: Restrict allowed database names? Scott Mead <scott.lists@enterprisedb.com>
Re: Restrict allowed database names? Adrian von Bidder <avbidder@fortytwo.ch>

On Sat, Mar 20, 2010 at 5:24 PM, Adam Seering <aseering@mit.edu> wrote:
Hi,
       I'm trying to set up an internal general-purpose PostgreSQL server installation.  I want most users with login access to the server to be able to create databases, but only with names that follow a specified naming convention (in particular, approximately "is prefixed with the owner's username").  A subset of administrative users can create users with any name.  The goal is to let users create arbitrary databases, but to force them to get approval for names that someone else (or some other service) might conceivably want.

       Is there any way to enforce this within PostgreSQL?  Maybe something like a trigger on CREATE DATABASE, if that's possible?

Hmmm... nothing like that I'm afraid... 

  But, you could possibly make a shell script to the 'createdb' executable that would force a name-style, but even then, for any user to be able to successfully run the command, they need database logon / create database privs, so if someone : cat `which createdb` and you had made a script, they'd see what you were up to.  It may be a way to get started though.

--Scott M
В списке pgsql-general по дате отправления
От: Adam Seering
Дата:
От: Steve Atkins
Дата:
FAQ