On Sun, May 15, 2011 at 2:13 AM, Darren Duncan <dar...@darrenduncan.net> wrote: > > ('1800-01-01 00:00:00'::timestamp)::int > > Now, since all values of a DOMAIN are also values of the base type the > DOMAIN is defined as being a subset of, then the sub-expression within the > parenthesis denotes a value that is both a timestamp and a datetime at the > same time. > > So, if a generic "CAST(timestamp as int)" is already defined, and you define > a "CAST(datetime as int)", then what should the above code (correct for > misspelling) do, or should it fail? >
Obviously it should run the cast from timestamp to int, why it will run a cast from a domain? the other way should be allowed, though... a cast from datetime to int should first look for cast function using the domain and if it don't find it then with base type -- Jaime Casanova www.2ndQuadrant.com Professional PostgreSQL: Soporte y capacitación de PostgreSQL -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers