can i create a database programmatically?

Поиск
Список
Период
Сортировка
От Zhenchang Xing
Тема can i create a database programmatically?
Дата
Msg-id Pine.LNX.4.44.0410181507480.18075-100000@cambria.cs.ualberta.ca
обсуждение исходный текст
Ответы Re: can i create a database programmatically?  (Steven Klassen <sklassen@commandprompt.com>)
Список pgsql-novice
hi,

The problem I have is: I have a database template, which define several
tables, contain some pre-defined data, and some server-side extensions,
and so on.

I am doing software evolution analysis. A user of my application can
define one or more analysis sets, which contain different sets of software
products. I want each analysis set to have a corresponding database
created from the template. But I don't want the user to create it on the
command line, such as using createdb. The way I want them to use my
application is, just select the software products of their interest and
give the analysis set a name, and then my applicatin will take care of
creating the corresponding database (with the specified name) for them. So
the question is, can I create
a database programmatically? It seems I can't through client interfaces,
such as JDBC, since they require to connect to a database first. Can I
connect to built-in template1 database, and call, for example,
execute("CREATE DATABASE newdb ...") from within JDBC?

thanks
zhenchang


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: INSERT has more target columns than expressions
Следующее
От: Steven Klassen
Дата:
Сообщение: Re: can i create a database programmatically?