ALTER TYPE 2: skip already-provable no-work rewrites

Поиск
Список
Период
Сортировка
От Noah Misch
Тема ALTER TYPE 2: skip already-provable no-work rewrites
Дата
Msg-id 20110109220141.GC5777@tornado.leadboat.com
обсуждение исходный текст
Ответы Re: ALTER TYPE 2: skip already-provable no-work rewrites  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
This patch removes ALTER TYPE rewrites in cases we can already prove valid.  I
add a function GetCoerceExemptions() that walks an Expr according to rules
discussed in the design thread, simplified slightly pending additions in the
next patch.  See the comment at that function for a refresher.  I use it to
populate two new bools to AlteredTableInfo, "new_bits" and "mayerror".
"new_bits" is a superset of "new_changedoids", so I subsume that.  I change
ATRewriteTable to act on those and support the notion of evaluating the
transformation expressions when we're not rewriting the table.

As unintended fallout, it's no longer an error to add oids or a column with a
default value to a table whose rowtype is used in columns elsewhere.  This seems
best.  Defaults on the origin table do not even apply to new inserts into such a
column, and the rowtype does not gain an OID column via its table.

This helps on conversions like varchar(X)->text, xml->text, and conversions
between domains and their base types.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: ALTER TYPE 1: recheck index-based constraints
Следующее
От: Noah Misch
Дата:
Сообщение: ALTER TYPE 3: add facility to identify further no-work cases