pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: John Naylor <john.naylor@2ndquadrant.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: assert pg_class.relnatts is consistent
Date: Fri, 14 Feb 2020 12:29:26 -0300
Message-ID: <20200214152926.GA7006@alvherre.pgsql> (raw)
In-Reply-To: <CACPNZCsf+u8w8QK0DBF4yB66A-dQTpJXqNr7cwnXYE6VVz87hA@mail.gmail.com>

On 2020-Feb-14, John Naylor wrote:

> One possible objection to what I wrote above is that it adds a
> different kind of special case, but in a sneaky way. Perhaps it would
> be more principled to treat it the same as oid after all. If we do
> that, it would help to add a comment that we can't treat relnatts like
> pronangs, since we need more information than what's in each pg_class
> row.

How about something like this? (untested)

		# oids are a special case; ignore
		next if $attname eq 'oid';
		# pg_class.relnatts is computed from pg_attribute rows; ignore
		next if $catname eq 'pg_class' and $attname eq 'relnatts';

		# Raise error unless a value exists.
		die "strip_default_values: $catname.$attname undefined\n"
		  if !defined $row->{$attname};

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





view thread (20+ messages)  latest in thread

Message-ID: <20200214152926.GA7006@alvherre.pgsql>
Permalink:  ../20200214152926.GA7006@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200214152926.GA7006@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, john.naylor@2ndquadrant.com, amitlangote09@gmail.com, tgl@sss.pgh.pa.us, pryzby@telsasoft.com
  Subject: Re: assert pg_class.relnatts is consistent
  In-Reply-To: <20200214152926.GA7006@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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