Re: Casting Point to Text

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Casting Point to Text
Дата
Msg-id
29593.1070981803@sss.pgh.pa.us
Ответ на
Casting Point to Text (Martin Hart)
Список
Дерево обсуждения
Casting Point to Text Martin Hart <martin@zsdfherg.com>
Re: Casting Point to Text Tom Lane <tgl@sss.pgh.pa.us>
Re: Casting Point to Text Martin Hart <martin@zsdfherg.com>
Re: Casting Point to Text Tom Lane <tgl@sss.pgh.pa.us>
Martin Hart  writes:
> db=# select '(1,2)'::point::text;
> ERROR:  cannot cast type point to text

> the only way i have been able to achieve it is to write a plpgsql function:
> while this appears to work fine - I am wondering if I am missing something 
> fundamental - specifically whether or not there is an inbuilt way to do it 
> (which I guess there must be for the plpgsql function to work)?

plpgsql is effectively doing

regression=# select textin(point_out('(1,2)'::point));
 textin
--------
 (1,2)
(1 row)

There is not a one-step cast function for this.  (Not for any
fundamental reason, just a lack of round tuits.)

			regards, tom lane
В списке pgsql-general по дате отправления
От: Joshua D. Drake
Дата:
От: Paul Thomas
Дата:
Сообщение: Re: Select for update Question
FAQ