1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Allow I/O conversion casts to be applied to or from any type that is a member

of the STRING type category, thereby opening up the mechanism for user-defined
types.  This is mainly for the benefit of citext, though; there aren't likely
to be a lot of types that are all general-purpose character strings.
Per discussion with David Wheeler.
This commit is contained in:
Tom Lane
2008-07-30 21:23:17 +00:00
parent 7df49cef72
commit c8572986ad
4 changed files with 43 additions and 32 deletions

View File

@ -323,6 +323,6 @@ SELECT COUNT(*) = 19::bigint AS t FROM try;
SELECT like_escape( name, '' ) = like_escape( name::text, '' ) AS t FROM srt;
SELECT like_escape( name::text, ''::citext ) =like_escape( name::text, '' ) AS t FROM srt;
--- TODO: Get citext working with magic cast functions?
SELECT cidr( '192.168.1.2'::citext ) = cidr( '192.168.1.2'::text ) AS "t TODO";
SELECT '192.168.1.2'::cidr::citext = '192.168.1.2'::cidr::text AS "t TODO";
--- citext should work as source or destination of I/O conversion casts
SELECT cidr( '192.168.1.2'::citext ) = cidr( '192.168.1.2'::text ) AS "t";
SELECT '192.168.1.2'::cidr::citext = '192.168.1.2'::cidr::text AS "t";