Thread: Typecast

Typecast

From
Nick Raj
Date:
Hi,
Can anybody tell me how to typecast data type Point into Datum?

Thanks
Nick

Re: Typecast

From
Chetan Suttraway
Date:


On Fri, Apr 15, 2011 at 10:29 PM, Nick Raj <nickrajjain@gmail.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, The Enterprise PostgreSQL company.



Re: Typecast

From
Nick Raj
Date:
Thanks dude

On Mon, Apr 18, 2011 at 2:25 PM, Chetan Suttraway <chetan.suttraway@enterprisedb.com> wrote:


On Fri, Apr 15, 2011 at 10:29 PM, Nick Raj <nickrajjain@gmail.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, The Enterprise PostgreSQL company.