Re: cmd-line interface

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Re: cmd-line interface
Дата
Msg-id 009f01c12503$459a8a50$7889ffcc@comstock.com
обсуждение исходный текст
Ответ на cmd-line interface  (Craig Longman <craigl@begeek.com>)
Список pgsql-general
> > 2) wrap a file in an explicit transaction
> [snipped]
> > is 2) possible right now?  i can't see anything in the docs, so i think
> > not.  anyway, having this sort of control would really help.  our
> > scripts need to run on various servers, and some things use different
> > syntax for transactions, db2 is 'rollback/commit work'.
>
> Bit trickier this one. I'd do it in perl (you can probably do it in shell,
> but I'm not good enough). Steps would be:
>
> 1. parse command-line parameters
> 2. open pipe to psql with all parameters except "-f filename" (if there)
> 3. write "BEGIN;" to psql
> 4. WHILE not EOF read STDIN/file listed on command-line
> 5. write "COMMIT;" to psql
>
> With the appropriate error-checking etc.

And don't forget to strip out the possible BEGINs and COMMITs in the file
since PostgreSQL doesn't support nested transactions.

Greg


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

Предыдущее
От: "Richard Huxton"
Дата:
Сообщение: Re: cmd-line interface
Следующее
От: Allan Engelhardt
Дата:
Сообщение: Re: Perfomance decreasing