Re: ask for parts of a user defined types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ask for parts of a user defined types
Дата
Msg-id 21935.1113324577@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ask for parts of a user defined types  (Kjetil Haaland <kjetil.haaland@student.uib.no>)
Список pgsql-novice
Kjetil Haaland <kjetil.haaland@student.uib.no> writes:
> I am wondering if it is possible to select values from user defined types.
> That is, if a new type is defined like for example the Complex type in the
> documentation, is it then possible to select just one of the double values
> that this type keeps?

Yes, but there are some syntactic issues that get in the way because
"foo.bar" is a table name and field name according to the SQL standard.

In PG >= 8.0 you can select a field from something that isn't a table
by parenthesizing; see the examples here:
    http://www.postgresql.org/docs/8.0/static/rowtypes.html

In earlier versions you frequently have to fall back on the old PostQUEL
functional syntax: write bar(foo) where you mean foo.bar.

            regards, tom lane

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

Предыдущее
От: Kjetil Haaland
Дата:
Сообщение: ask for parts of a user defined types
Следующее
От: "Keith Worthington"
Дата:
Сообщение: Using an SRF with VB6