pg_get_statisticsextdef() is not quite the full shilling

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: pg_get_statisticsextdef() is not quite the full shilling
Date: 2017-03-25 01:42:50
Message-ID: CAKJS1f8RjLeVZJ2+93pdQGuZJeBF-ifsHaFMR-q-6-Z0qxA8cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Seems pg_get_statisticsextdef() has a couple of things wrong:

1. HeapTupleIsValid() called on the wrong tuple.
2. Did not schema qualify names.

Both of which were my mistakes.

The attached fixes.

I've also added some tests to give the function a bit of coverage.

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.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
pg_get_statisticsextdef_fix.patch application/octet-stream 4.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2017-03-25 02:10:59 crashes due to setting max_parallel_workers=0
Previous Message Thomas Munro 2017-03-25 00:59:13 Re: dsm.c API tweak