Обсуждение: Creating DB

Поиск
Список
Период
Сортировка

Creating DB

От
"Lorenzo De Vito"
Дата:

Is the only way to create DB in a C code to connect to Template1 and then exec the SQL string "CREATE DATABASE databasename" ?
Can I create DB without connecting to template1 ?

Re: Creating DB

От
Tom Lane
Дата:
"Lorenzo De Vito" <lorenzodevito@email.it> writes:
> Is the only way to create DB in a C code to connect to Template1 and then e=
> xec the SQL string "CREATE DATABASE databasename" ?
> Can I create DB without connecting to template1 ?

You have to connect to *some* DB.  Doesn't have to be template1, but
that's the most usual choice since it's certain to exist.

            regards, tom lane