Re: DOMAINs and CASTs
От | Jaime Casanova |
---|---|
Тема | Re: DOMAINs and CASTs |
Дата | |
Msg-id | BANLkTik46G=KRKgdVYru+VxZaViC0cZacQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: DOMAINs and CASTs (Darren Duncan <darren@darrenduncan.net>) |
Ответы |
Re: DOMAINs and CASTs
|
Список | pgsql-hackers |
On Sun, May 15, 2011 at 2:13 AM, Darren Duncan <darren@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
В списке pgsql-hackers по дате отправления: