Re: Dropping all tables in a database

Поиск
Список
Период
Сортировка
Искать
От
Christophe Pettus
Тема
Re: Dropping all tables in a database
Дата
Msg-id
A645BF48-B811-425B-B924-0E7E094E7C46@thebuild.com
Ответ на
Список
Дерево обсуждения
Dropping all tables in a database H <agents@meddatainc.com>
Re: Dropping all tables in a database Thorsten Glaser <tg@evolvis.org>
Re: Dropping all tables in a database Christophe Pettus <xof@thebuild.com>
Re: Dropping all tables in a database H <agents@meddatainc.com>
Re: Dropping all tables in a database "David G. Johnston" <david.g.johnston@gmail.com>
Re: Dropping all tables in a database Julien Rouhaud <rjuju123@gmail.com>
Re: Dropping all tables in a database Thomas Kellerer <shammat@gmx.net>


> On Aug 6, 2023, at 18:17, H  wrote:
> 
> Is there some setting I have to change in the database to have the first SQL statement to work or have I run into a possible bug?

The first statement just generates a line of text output that contains the statement.  There's nothing in it that would cause that statement to be executed.

If you want to create a statement dynamically and then execute it, you can do that with pl/pgSQL:

	https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

Otherwise, the solution is to do as you did: write the output to a file, trim out any extraneous lines, and then use that as a script.

В списке pgsql-general по дате отправления
От: H
Дата:
От: Julien Rouhaud
Дата:
FAQ