Re: pg_get_statisticsextdef() is not quite the full shilling

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_get_statisticsextdef() is not quite the full shilling
Date: 2017-03-27 04:06:13
Message-ID: 20170327040613.wndaa6lmh5czlmkp@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley wrote:

> Seems pg_get_statisticsextdef() has a couple of things wrong:
>
> 1. HeapTupleIsValid() called on the wrong tuple.
> 2. Did not schema qualify names.

Actually we can solve both 1 and the first half of 2 by just using
generate_relation_name, which is less code and gives better results
(because we then schema-qualify the relation name conditionally). I
patched the other half of 2 using your approach, but I wonder if we
should have a function StatisticsIsVisible or something.

> I've purposefully left out the WITH syntax. We'll want to add some
> logic around that once we have more than one statistic type supported.
> I'd suggest not appending WITH if all supported types are present, and
> only appending it if a true subset are present. That'll mean pg_dump
> from v10 and import into v11 will get all types, if they did in v10,
> and the same subset that they did in v10 when only a subset were
> originally defined.
>
> Since we support only 1 type now, nothing needs to happen there yet.

Yeah, this sounds sensible to me.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rushabh Lathia 2017-03-27 05:29:21 Re: crashes due to setting max_parallel_workers=0
Previous Message Dilip Kumar 2017-03-27 03:51:04 Re: Problem in Parallel Bitmap Heap Scan?