From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Dan Libby <dan(at)libby(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: text to point conversion not working. ( cannot cast type text to point ) |
Date: | 2006-09-28 10:28:05 |
Message-ID: | 20060928102805.GC10591@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Sep 27, 2006 at 08:14:29PM -0600, Dan Libby wrote:
> Hi all,
>
> Using pgsql 8.0.1
>
> I'm just starting with using the geometry data types in postgres, and ran into
> what seems like a very basic problem. Namely, I can't seem to convert/cast
> type text into type point when that text results from any expression. Ie, it
> *only* works for a plain string literal.
String literals are not text. You can however cheat a little like so:
# SELECT point_in( textout ( '1' || ',2' ) );
point_in
----------
(1,2)
(1 row)
textout turns a text value to a "string literal" (sort of) which is
then parsed by the point input function.
If you want you can encapsulate this into a function and create the
cast yourself.
Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2006-09-28 10:31:37 | Re: Definition of return types for own functions? |
Previous Message | Adnan DURSUN | 2006-09-28 10:27:24 | Can i see server SQL commands ? |