Thread: Extension development

Extension development

From
Yonatan Misgan
Date:

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: yonamis@dtu.edu.et

        yonathanmisgan.4@gmail.com

Tel:   (+251)-911180185 (mob)

 

Re: Extension development

From
Jeevan Ladhe
Date:
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 <yonamis@dtu.edu.et> 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: yonamis@dtu.edu.et

        yonathanmisgan.4@gmail.com

Tel:   (+251)-911180185 (mob)

 

Re: Extension development

From
Ahsan Hadi
Date:
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 <yonamis@dtu.edu.et> 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: yonamis@dtu.edu.et

        yonathanmisgan.4@gmail.com

Tel:   (+251)-911180185 (mob)

 



--
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: ahsan.hadi@highgo.ca

RE: Extension development

From
Yonatan Misgan
Date:

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: yonamis@dtu.edu.et

        yonathanmisgan.4@gmail.com

Tel:   (+251)-911180185 (mob)

 


From: Ahsan Hadi <ahsan.hadi@gmail.com>
Sent: Tuesday, November 12, 2019 10:50:23 PM
To: Yonatan Misgan <yonamis@dtu.edu.et>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
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 <yonamis@dtu.edu.et> 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: yonamis@dtu.edu.et

        yonathanmisgan.4@gmail.com

Tel:   (+251)-911180185 (mob)

 



--
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: ahsan.hadi@highgo.ca