Extension development

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Extension development

Yonatan Misgan

I am developed my own PostgreSQL extension for learning purpose and it is working correctly but I want to know to which components of the database is my own extension components communicate. For example I have c code, make file sql script, and control file after compiling the make file to which components of the database are each of my extension components to communicate. Thanks for your response.  

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 

Reply | Threaded
Open this post in threaded view
|

Re: Extension development

Jeevan Ladhe
Hi Yonatan,

Here is an attempt to explain the components of the extension:

Makefile:
Makefile provides a way to compile your C code. Postgres provides an infrastructure called PGXS for building the extensions against installed Postgres server. More of this can be found in official documentation[1].

Control file:
It specifies some properties/metadata about the extension, like version, comments, directory etc. Official documentation[2]

SQL Script:
This file should be of format extension—version.sql which will have the functions that are either pure SQL functions, or interfaces for your C functions and other SQL objects to assist your functions etc. This will be executed internally by “CREATE EXTENSION” command.

C code:
Your C code is real implementation of your extension. Here you can have C implementations of SQL interface functions your declared in your .sql script file, register callbacks e.g. things you want to do post parse, before execution of a query etc. The filename can be anything but you should have PG_MODULE_MAGIC included in your C file.

Using this infrastructure one can simply do make, make install and then “CREATE EXTENSION” command to create objects. This helps keeping track of all the extension objects together, create them at once, and drop once with “DROP EXTENSION” command. Here[3] is complete documentation for extension. 

Regards,
Jeevan Ladhe


On Tue, Nov 12, 2019 at 12:24 PM Yonatan Misgan <[hidden email]> wrote:

I am developed my own PostgreSQL extension for learning purpose and it is working correctly but I want to know to which components of the database is my own extension components communicate. For example I have c code, make file sql script, and control file after compiling the make file to which components of the database are each of my extension components to communicate. Thanks for your response.  

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 

Reply | Threaded
Open this post in threaded view
|

Re: Extension development

Ahsan Hadi-2
In reply to this post by Yonatan Misgan
Hi Yonatan,

You can follow this blog for creating your own extension in PostgreSQL..


-- Ahsan

On Tue, Nov 12, 2019 at 11:54 AM Yonatan Misgan <[hidden email]> wrote:

I am developed my own PostgreSQL extension for learning purpose and it is working correctly but I want to know to which components of the database is my own extension components communicate. For example I have c code, make file sql script, and control file after compiling the make file to which components of the database are each of my extension components to communicate. Thanks for your response.  

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 



--
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Extension development

Yonatan Misgan
In reply to this post by Yonatan Misgan

Is there any one who help me what the architecture of an extension should looks like in PostgreSQL database.

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 

Reply | Threaded
Open this post in threaded view
|

RE: Extension development

Yonatan Misgan
In reply to this post by Ahsan Hadi-2

I have done the hard code. But my question is related to the concept how these extension components working together as a system. For example what the use case diagram looks like for my extension and also the other architectural view of the extension should look like.

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 


From: Ahsan Hadi <[hidden email]>
Sent: Tuesday, November 12, 2019 10:50:23 PM
To: Yonatan Misgan <[hidden email]>
Cc: [hidden email] <[hidden email]>
Subject: Re: Extension development
 
Hi Yonatan,

You can follow this blog for creating your own extension in PostgreSQL..


-- Ahsan

On Tue, Nov 12, 2019 at 11:54 AM Yonatan Misgan <[hidden email]> wrote:

I am developed my own PostgreSQL extension for learning purpose and it is working correctly but I want to know to which components of the database is my own extension components communicate. For example I have c code, make file sql script, and control file after compiling the make file to which components of the database are each of my extension components to communicate. Thanks for your response.  

 

Regards,

____________________________________

Yonathan Misgan 

Assistant Lecturer, @ Debre Tabor University

Faculty of Technology

Department of Computer Science

Studying MSc in Computer Science (in Data and Web Engineering) 

@ Addis Ababa University 

E-mail: [hidden email]

        [hidden email]

Tel:   (+251)-911180185 (mob)

 



--
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: [hidden email]