Re: Using substr with user defined types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using substr with user defined types
Дата
Msg-id 21185.958618355@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Using substr with user defined types  (darcy@druid.net (D'Arcy J.M. Cain))
Ответы Re: Using substr with user defined types  (darcy@druid.net (D'Arcy J.M. Cain))
Список pgsql-sql
darcy@druid.net (D'Arcy J.M. Cain) writes:
> I created a type (for passwords) but I can't seem to use substr.  I
> suppose that's because it is my own type because the errors suggest that
> there is no substr (actually it says ltrim) function for that type.

Yup --- the system has no idea how to apply any functions to a
user-defined type except the ones you specifically define for that type.

If you make a type-conversion function "text(yourtype) returns text"
then the system will figure out that it should apply that function
whenever you use your type as the argument of a function that needs
text.  But without such a function, the system will not assume that
it can do anything text-ish with the datatype.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Daniel Mendyke
Дата:
Сообщение: Automatic index numbers
Следующее
От: "Gerhard Dieringer"
Дата:
Сообщение: Antw: Automatic index numbers