Re: BUG #15101: function set search_path = '' breaks dump/restore

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: andrew(at)tao11(dot)riddles(dot)org(dot)uk, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15101: function set search_path = '' breaks dump/restore
Date: 2018-03-08 08:19:55
Message-ID: 20180308081955.GG1788@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Gierth 2018-03-08 08:54:56 Re: BUG #15101: function set search_path = '' breaks dump/restore
Previous Message Michael Paquier 2018-03-08 08:08:58 Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identity column