Spec on pg_cast table/CREATE CAST command

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Spec on pg_cast table/CREATE CAST command
Дата
Msg-id Pine.LNX.4.44.0207152143170.2259-100000@localhost.localdomain
обсуждение исходный текст
Ответы Re: Spec on pg_cast table/CREATE CAST command  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Command syntax is
 CREATE CAST (source AS target) WITH FUNCTION name(arg) [AS ASSIGNMENT]

in compliance with SQL99 (AS ASSIGNMENT means implicitly invokable).

Declaration of binary compatible casts:
 CREATE CAST (source AS target) WITHOUT FUNCTION [AS ASSIGNMENT]

Does not have to be implicit (although it must be for use in function
argument resultion, etc.).  You must declare both directions explicitly.

Cast functions must be immutable.  This is following SQL99 as well.

Compatibility:

The old way to create casts has already been broken in 1.5 ways: the
introduction of the implicit flag and the introduction of schemas.  To
maintain full compatibility we'd have to revert to making the implicit
flag the default, which would undermine the compliance of the new CREATE
CAST command from the start.

Hence I suggest that we migrate through pg_dump: User-defined functions
that would have been casts up to 7.2 will emit an appropriate CREATE CAST
command.  This in combination with a release note will also give the users
a better chance to inspect the dump and adjust the cast specifications for
implicitness as they wish.

Comments?

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: DROP COLUMN
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BlockNumber fixes