Re: REGARDING ADDING A DATATYPE LIKE POLYGON

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Bibek Behera <bibek(dot)iitkgp(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: REGARDING ADDING A DATATYPE LIKE POLYGON
Date: 2012-05-04 12:21:55
Message-ID: CAHnozTg75TOoFXr-nyemXiNyxwUAJ1tcMqWEJZYpxf+fTH=wEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You should start here:http://www.postgresql.org/docs/9.1/static/extend.html

Interesting sections of that page :
if you want to make a completely new type:(35.11)
http://www.postgresql.org/docs/9.1/static/xtypes.html
Or if a DOMAIN will do:(an existing type with constraints, 35.2.3):
http://www.postgresql.org/docs/9.1/static/extend-type-system.html#AEN49589
there's also a YouTube video about domains from Cybertech:
http://www.youtube.com/watch?v=wa-x4p6oHus

HTH,

WBL

On Fri, May 4, 2012 at 4:30 AM, Bibek Behera <bibek(dot)iitkgp(at)gmail(dot)com> wrote:

> i MEANT I AM ASKED DO it as a project to introduce a new data type that is
> similar to polygon but not the same.Please tell me how to achieve this
> thing.
>
>
> On Thu, May 3, 2012 at 6:24 PM, Willy-Bas Loos <willybas(at)gmail(dot)com> wrote:
>
>> you could use postgis. it has a geometry datatype. you can define it to
>> be a polygon.
>> like so:
>> create table test(id serial primary key);
>> select addgeometrycolumn('public', 'test', 'the_geom', 4326, 'POLYGON',
>> 2);
>>
>> hth
>>
>> WBL
>>
>>
>> On Thu, May 3, 2012 at 1:04 PM, Bibek Behera <bibek(dot)iitkgp(at)gmail(dot)com>wrote:
>>
>>> Where in the postgres source code should we make changes to run a sql
>>> query like
>>> create table test(a polygon2)
>>>
>>> --
>>> Regards,
>>> Bibek behera
>>> IIT Bombay
>>>
>>>
>>> Ph no.- 8879005749
>>>
>>>
>>
>>
>> --
>> "Quality comes from focus and clarity of purpose" -- Mark Shuttleworth
>>
>>
>
>
> --
> Regards,
> Bibek behera
> IIT Bombay
>
>
> Ph no.- 8879005749
>
>

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message James David Smith 2012-05-04 12:31:38 Re: Import CSV with Dates & Times
Previous Message Simon Riggs 2012-05-04 11:47:46 Re: Import CSV with Dates & Times