Re: Domains (Was [PERFORM] Views With Unions)
От | Jochem van Dieten |
---|---|
Тема | Re: Domains (Was [PERFORM] Views With Unions) |
Дата | |
Msg-id | 3F2BE6DF.2060706@oli.tudelft.nl обсуждение исходный текст |
Ответ на | Domains (Was [PERFORM] Views With Unions) (Francisco J Reyes <fran@natserv.net>) |
Ответы |
Re: Domains (Was [PERFORM] Views With Unions)
Re: Domains (Was [PERFORM] Views With Unions) |
Список | pgsql-general |
Francisco J Reyes wrote: > Are domains user defined types? That they seem to be based on what I see > on the docs. They are similar a bit to user defined types, but there are some important differences. First of all, domains are based on other datatypes, so you would have to have an existing datatype that is a sufficiently close match. Secondly, domains can be mixed directly with the datatype they are based on and other domains that are based on that datatype. User defined types require you to first cast them (which in turn implies a casting function needs to be defined) to the other/a common type before you can mix them. Overall, I tend to see them more as macro's then as real datatypes. Typically I use them to verify that data is properly formatted (like the phone number example). Please note that the SQL:1999 concept of user defined types is quite different from the one in PostgreSQL (in his book "Advanced SQL:1999" Jim Melton even warns that domains may be deprecated in future SQL standards in favour of SQL-style user defined types). Jochem
В списке pgsql-general по дате отправления: