Re: Install scripts?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Install scripts?
Дата
Msg-id 6706.1109354832@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Install scripts?  (Charl Gerber <cpger@xs4all.nl>)
Список pgsql-general
Charl Gerber <cpger@xs4all.nl> writes:
> There is one 'install.sql' file which does something like:

> DROP DATABASE db_name IF EXISTS   (<--- is there something similar in
> Postgre? Like the CREATE OR REPLACE FUNCTION)

> CREATE DATABASE db_name;

There's no IF EXISTS.  Usually people just do a DROP and ignore the
error if any.

> How do you do this with Postgre? I tried using the "insert filename"
> command, but one file cannot seem to load another (ie, a SELECT filename
> gives me an error) and to start with, I cannot find something similar to
> "USE DATABASE" ....

You probably want to be looking at psql's \i and \c commands,
respectively.  Does "insert foo" really mean a file inclusion
command in MySQL?  Bizarre ...

            regards, tom lane

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

Предыдущее
От: Andreas 'ads' Scherbaum
Дата:
Сообщение: Re: Tracing of tables deleting - how?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Install scripts?