Re: Typecast

From: Chetan Suttraway <chetan(dot)suttraway(at)enterprisedb(dot)com>
To: Nick Raj <nickrajjain(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Typecast
Date: 2011-04-18 08:55:18
Message-ID: BANLkTimVtc4-JT2BtuFOH65z+iKoY2WNdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Apr 15, 2011 at 10:29 PM, Nick Raj <nickrajjain(at)gmail(dot)com> wrote:

> Hi,
> Can anybody tell me how to typecast data type Point into Datum?
>
> Thanks
> Nick
>

Assuming you are referring to c-code,

Point somepoint;
Datum result;

result = PointPGetDatum(&somepoint)

You can also checkout src/backend/utils/adt/geo_ops.c which has code for
conversion between
datum and point and vice-versa.

--
Regards,
Chetan Suttraway
EnterpriseDB <http://www.enterprisedb.com/>, The Enterprise
PostgreSQL<http://www.enterprisedb.com/>
company.

In response to

  • Typecast at 2011-04-15 16:59:05 from Nick Raj

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tore Halvorsen 2011-04-18 10:06:04 Re: Using column aliasses in the same query
Previous Message Adarsh Sharma 2011-04-18 08:01:01 Re: Postgres Start up Error