Site icon Database Tutorials

How To Create Stored Procedure,Function On PostgreSQL

 

Stored Procedure and Function concepts in PostgreSQL are not the same as in other relational databases.

Functions are used like stored procedures.

In some places you can hear it as a Stored function.

Below you can find a function script that does not return value.

This way you can use functions like stored procedures.

 

If you run the following script after creating the function, the corresponding record will be added to the table.

 

You can then use the following script to check the table.

 

Below you can see a function script that returns a result set.

 

You can execute it as follows.

 

The result will be as follows.

<unnamed portal 1>

 

Then you can get the result by script as below.

Exit mobile version