pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15101: function set search_path = '' breaks dump/restore
3+ messages / 3 participants
[nested] [flat]
* BUG #15101: function set search_path = '' breaks dump/restore
@ 2018-03-08 06:59 PG Bug reporting form <noreply@postgresql.org>
2018-03-08 08:19 ` Re: BUG #15101: function set search_path = '' breaks dump/restore Michael Paquier <michael@paquier.xyz>
2018-03-08 08:54 ` Re: BUG #15101: function set search_path = '' breaks dump/restore Andrew Gierth <andrew@tao11.riddles.org.uk>
0 siblings, 2 replies; 3+ messages in thread
From: PG Bug reporting form @ 2018-03-08 06:59 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: andrew@tao11.riddles.org.uk
The following bug has been logged on the website:
Bug reference: 15101
Logged by: Andrew Gierth
Email address: andrew@tao11.riddles.org.uk
PostgreSQL version: 10.3
Operating system: any
Description:
Given:
create or replace function foo()
returns text language sql
as $$
select current_schemas(true)::text;
$$
set search_path = '';
dump/restore (or \ef) fails with:
ERROR: zero-length delimited identifier at or near """"
The problem obviously being that pg_get_functiondef is returning invalid
syntax for the search_path setting.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #15101: function set search_path = '' breaks dump/restore
2018-03-08 06:59 BUG #15101: function set search_path = '' breaks dump/restore PG Bug reporting form <noreply@postgresql.org>
@ 2018-03-08 08:19 ` Michael Paquier <michael@paquier.xyz>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Paquier @ 2018-03-08 08:19 UTC (permalink / raw)
To: andrew@tao11.riddles.org.uk; pgsql-bugs@lists.postgresql.org
On Thu, Mar 08, 2018 at 06:59:21AM +0000, PG Bug reporting form wrote:
> create or replace function foo()
> returns text language sql
> as $$
> select current_schemas(true)::text;
> $$
> set search_path = '';
>
> dump/restore (or \ef) fails with:
>
> ERROR: zero-length delimited identifier at or near """"
>
> The problem obviously being that pg_get_functiondef is returning invalid
> syntax for the search_path setting.
In this context pg_get_functiondef assigns quote as it sees that
search_path is of type GUC_LIST, which needs special handling. Likely
this needs more thoughts for empty values.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #15101: function set search_path = '' breaks dump/restore
2018-03-08 06:59 BUG #15101: function set search_path = '' breaks dump/restore PG Bug reporting form <noreply@postgresql.org>
@ 2018-03-08 08:54 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Gierth @ 2018-03-08 08:54 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:
PG> Given:
PG> create or replace function foo()
PG> returns text language sql
PG> as $$
PG> select current_schemas(true)::text;
PG> $$
PG> set search_path = '';
For the record, the workaround I suggested to the user on IRC who ran
into this issue was:
alter function foo() set search_path = pg_catalog;
which has (as far as I can tell) exactly the same runtime effect as
setting it to '' but doesn't break dump/restore.
--
Andrew (irc:RhodiumToad)
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-03-08 08:54 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 06:59 BUG #15101: function set search_path = '' breaks dump/restore PG Bug reporting form <noreply@postgresql.org>
2018-03-08 08:19 ` Michael Paquier <michael@paquier.xyz>
2018-03-08 08:54 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox