Thread: PostgreSQLs Extension

PostgreSQLs Extension

From
"Anderson C. Carniel"
Date:
Hi!

I am developing a work that will need to make some changes in the PostgreSQL source code. More precisely, I'll also make changes in the PostGIS extension. So I work with geographic data.

I wonder if someone can show me a better way for me to make such changes in PostgreSQL:

-> I need to set a new data type specific, as the PostGIS. I saw that in PostgreSQL's Documentation there is a User-Defined Types. This is the best way to define a new data type? Using this approach, can I define the way queries are processed and thus define new operators? Or would I define functions via pgsql for this? It was not clear to me.
-> Also, how could I make changes to the SQL language in PostgreSQL?

Sorry about questions, but I would only driving directions, because it is so complex.

Thank you in advance for your attention.


[]s
Anderson Carniel

Re: PostgreSQLs Extension

From
Jaime Casanova
Date:
On Thu, Jul 26, 2012 at 2:56 PM, Anderson C. Carniel
<accarniel@gmail.com> wrote:
>
> -> I need to set a new data type specific, as the PostGIS. I saw that in
> PostgreSQL's Documentation there is a User-Defined Types. This is the best
> way to define a new data type? Using this approach, can I define the way
> queries are processed and thus define new operators? Or would I define
> functions via pgsql for this? It was not clear to me.

you can create new data types, new operators, new types of indexes if
you want... the question is, what are you trying to do?

> -> Also, how could I make changes to the SQL language in PostgreSQL?
>

what kind of changes?

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación


Re: PostgreSQLs Extension

From
"Anderson C. Carniel"
Date:
Hi!

Thanks for quick response. 

> you can create new data types, new operators, new types of indexes if
> you want... the question is, what are you trying to do? 

I want to define a new type of geographic data, as well as the PostGIS's data. Also, my intention is to define new topological operators (eg intersection). 
For this, I wonder if using the approach of User-Defined Types is best. With this approach can I change the query processing to handle the new type the way I want? This approach directly affects the performance in query processing?


> what kind of changes?

Also, maybe I'll make changes to the SQL language and implement them in PostgreSQL. Per example, changes in syntax and define new reserved words (for any specific treatment, when it detected my data type).

Thanks for help.

Best regards,

Anderson Carniel
[]s

> From: jaime@2ndquadrant.com
> Date: Fri, 27 Jul 2012 19:51:53 -0500
> Subject: Re: [HACKERS] PostgreSQLs Extension
> To: accarniel@gmail.com
> CC: pgsql-hackers@postgresql.org
>
> On Thu, Jul 26, 2012 at 2:56 PM, Anderson C. Carniel
> <accarniel@gmail.com> wrote:
> >
> > -> I need to set a new data type specific, as the PostGIS. I saw that in
> > PostgreSQL's Documentation there is a User-Defined Types. This is the best
> > way to define a new data type? Using this approach, can I define the way
> > queries are processed and thus define new operators? Or would I define
> > functions via pgsql for this? It was not clear to me.
>
> you can create new data types, new operators, new types of indexes if
> you want... the question is, what are you trying to do?
>
> > -> Also, how could I make changes to the SQL language in PostgreSQL?
> >
>
> what kind of changes?
>
> --
> Jaime Casanova www.2ndQuadrant.com
> Professional PostgreSQL: Soporte 24x7 y capacitación