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 <martin@zsdfherg.com>)
Ответы Re: Casting Point to Text
Список pgsql-general
Martin Hart <martin@zsdfherg.com> 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"
Дата:
Сообщение: Re: Shell access & send email from PLPGSQL?
Следующее
От: Paul Thomas
Дата:
Сообщение: Re: Select for update Question