Обсуждение: REGARDING ADDING A DATATYPE LIKE POLYGON

Поиск
Список
Период
Сортировка

REGARDING ADDING A DATATYPE LIKE POLYGON

От
Bibek Behera
Дата:
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

Re: REGARDING ADDING A DATATYPE LIKE POLYGON

От
Willy-Bas Loos
Дата:
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.iitkgp@gmail.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

Re: REGARDING ADDING A DATATYPE LIKE POLYGON

От
Merlin Moncure
Дата:
On Thu, May 3, 2012 at 6:04 AM, Bibek Behera <bibek.iitkgp@gmail.com> wrote:
> Where in the postgres source code should we make changes to run a sql query
> like
> create table test(a polygon2)

postgres has a polygon type.  the built in postgres geometric types
are useful for storage and basic searching; if you need more than that
check out postgis (which is a heavy dependency so only use it if you
really need it).

merlin

Re: REGARDING ADDING A DATATYPE LIKE POLYGON

От
Willy-Bas Loos
Дата:
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.iitkgp@gmail.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@gmail.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.iitkgp@gmail.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