BUG #14700: pg_restore doesn't declare schema in 'create function' statements

From: psuderevsky(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14700: pg_restore doesn't declare schema in 'create function' statements
Date: 2017-06-09 16:31:44
Message-ID: 20170609163144.26508.40598@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14700
Logged by: Pavel Suderevsky
Email address: psuderevsky(at)gmail(dot)com
PostgreSQL version: 9.4.5
Operating system: Centos 7.2
Description:

Hi,

I couldn't find this bug reported here, but maybe community is aware.

When restoring only particular schema from dump with "pg_restore -n" it does
the following:
1. SET search_path = yourschema, pg_catalog
2. CREATE FUNCTION yourfunction()

As a result, if you had forgotten creating yourschema before restoring then
no objects will be restored except your functions, they will be restored in
pg_catalog schema.

These statements must be performed with direct schema reference: CREATE
FUNCTION yourschema.yourfunction().

Reproduced with dumping in 9.4.5 and restoring it to 9.4.5 and 9.6.2.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Arthur Nascimento 2017-06-09 16:54:10 Re: Re: [BUGS] BUG #14695: Documentation is not accurate
Previous Message konst583 2017-06-09 16:01:09 BUG #14699: Statement trigger and logical replication