Which SET TYPE don't actually require a rewrite

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Which SET TYPE don't actually require a rewrite
Дата
Msg-id CABUevEz=bw-LoxaJiN48Q9akYODPhadphoLYBH9Yor1HNr-obg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Which SET TYPE don't actually require a rewrite  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Which SET TYPE don't actually require a rewrite  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
Our Fine Manual (TM) specifies:
"As an exception, when changing the type of an existing column, if the USING clause does not change the column contents and the old type is either binary coercible to the new type or an unconstrained domain over the new type, a table rewrite is not needed; but any indexes on the affected columns must still be rebuilt."

First of all, how is a non-internals-expert even supposed to know what a binary coercible type is? That's not a very user-friendly way to say it.

Second, how is even an expert supposed to find the list? :)

For example, we can query pg_cast for casts that are binary coercible, that's a start, but it doesn't really tell us the answer.

We can also for example increase the precision of numeric without a rewrite (but not scale). Or we can change between text and varchar. And we can increase the length of a varchar but not decrease it.

Surely we can do better than this when it comes to documenting it? Even if it's a pluggable thing so it may or may not be true of external datatypes installed later, we should be able to at least be more clear about the builtin types, I think?

--

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Have SIGHUP instead of SIGTERM for config reload in logical replication launcher
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: some more pg_dump refactoring