appendPQExpBuffer(delcmd, "CREATE SCHEMA IF NOT EXISTS %s;\n", tbinfo->dobj.namespace->dobj.name);
( strncmp(dropStmt, "CREATE SCHEMA IF NOT EXISTS", 27) == 0 && strstr(dropStmt+29, "CREATE OR REPLACE VIEW") ))
Hello, When using pg_dump (or pg_restore) with option "--clean", there is some SQL code to drop every objects at the beginning. The DROP statement for a view involving circular dependencies is : CREATE OR REPLACE VIEW [...] (see commit message of d8c05aff for a much better explanation) If the view is not in the "public" schema, and the target database is empty, this statement fails, because the schema hasn't been created yet. The attached patches are a TAP test which can be used to reproduce the bug, and a proposed fix. They apply to the master branch. Best regards, Frédéric
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных