Re: assert pg_class.relnatts is consistent

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: assert pg_class.relnatts is consistent
Дата
Msg-id
20200214152926.GA7006@alvherre.pgsql
Ответ на
Список
Дерево обсуждения
assert pg_class.relnatts is consistent Justin Pryzby <pryzby@telsasoft.com>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Michael Paquier <michael@paquier.xyz>
Re: assert pg_class.relnatts is consistent Justin Pryzby <pryzby@telsasoft.com>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Tom Lane <tgl@sss.pgh.pa.us>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Michael Paquier <michael@paquier.xyz>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent John Naylor <john.naylor@2ndquadrant.com>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Alvaro Herrera <alvherre@2ndquadrant.com>
Re: assert pg_class.relnatts is consistent John Naylor <john.naylor@2ndquadrant.com>
Re: assert pg_class.relnatts is consistent Alvaro Herrera <alvherre@2ndquadrant.com>
Re: assert pg_class.relnatts is consistent Tom Lane <tgl@sss.pgh.pa.us>
Re: assert pg_class.relnatts is consistent Tom Lane <tgl@sss.pgh.pa.us>
Re: assert pg_class.relnatts is consistent Amit Langote <amitlangote09@gmail.com>
Re: assert pg_class.relnatts is consistent Justin Pryzby <pryzby@telsasoft.com>
Re: assert pg_class.relnatts is consistent John Naylor <john.naylor@2ndquadrant.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


В списке pgsql-hackers по дате отправления
От: Robert Haas
Дата:
От: Robert Haas
Дата:
FAQ