Re: Casting Point to Text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: martin(at)zsdfherg(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Casting Point to Text
Date: 2003-12-09 14:56:43
Message-ID: 29593.1070981803@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martin Hart <martin(at)zsdfherg(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Thomas 2003-12-09 15:41:24 Re: Select for update Question
Previous Message Joshua D. Drake 2003-12-09 14:41:57 Re: Shell access & send email from PLPGSQL?