varchar/name casts
От | Peter Eisentraut |
---|---|
Тема | varchar/name casts |
Дата | |
Msg-id | 200808151600.47471.peter_e@gmx.net обсуждение исходный текст |
Ответы |
Re: varchar/name casts
|
Список | pgsql-hackers |
With this query you can view all casts involving varchar: SELECT castsource::regtype, casttarget::regtype, castfunc::regprocedure, castcontext FROM pg_cast WHERE 'varchar'::regtype IN (castsource, casttarget) ORDER BY 1, 2; Note that varchar mostly "borrows" the cast functions from the text type. The exception is that there is a separate set of SQL-level functions for casting between name and varchar and vice versa. But these are actually matched to the same C-level functions as the casts between text and name (name_text() and text_name()). Does anyone recall a reason for this special case or is it just another dark area in the casting maze? If the latter, I would like to remove the extra functions and redefine the casts between varchar and name to use the SQL-level casting functions for the text type.
В списке pgsql-hackers по дате отправления: