Re: BUG #13840: pg_dump generates unloadable SQL when third party string type index option is used

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kouhei Sutou <kou(at)clear-code(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13840: pg_dump generates unloadable SQL when third party string type index option is used
Date: 2016-01-03 00:10:47
Message-ID: CAB7nPqS-opn9kTOGt0Memd0GkDNXPgtbawbqVLvavOWT0PL4nA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Jan 3, 2016 at 2:50 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Kouhei Sutou <kou(at)clear-code(dot)com> writes:
> > Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Pushed with some adjustments (notably, I thought the quoting rule was
> >> too complicated and not necessarily 100% correct).
>
> > Thanks for merging my patch and backporting to released
> > series.
>
> I looked into pg_dump and realized that this fixes only a few of the
> problems in this area. While pg_dump does rely on ruleutils.c to
> print reloptions of simple indexes, it does not do that for reloptions
> of tables or views, nor for reloptions of indexes that are constraints.
> So eventually that's going to bite us on the rear, though I'm not sure
> if we have a live problem today.

That's actually something that has been discussed some months ago
after trying to add units to those parameters (e23014f3 that got
reverted). At some point I guess we should add those quotes within
pg_class/reloptions directly in each element of its array, the new
per-relation log_autovacuum_min_duration being an extra argument in
favor of it.

> One could imagine exporting flatten_reloptions via a separate SQL
> function, but that could only exist in future releases, so I'm afraid
> we're going to have to duplicate the functionality inside pg_dump.

Yep, that's another option, though it seems to me that we had better
tackle this at its root, this routine doing some manual parsing of
each element.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message jonas.hagen3 2016-01-04 09:23:52 BUG #13842: deb-Package configuration hangs at password promt
Previous Message Guillaume Lelarge 2016-01-02 18:01:25 Re: BUG #13841: Unable to set autocommit in psql