Google News
logo
PostgreSQL - Interview Questions
Does Postgresql have SPs/ Stored Procedures?
PostgreSQL doesn't have Stored Procedures directly.
 
However, by working with Object Relational Database Management Systems i.e., PostgreSQL have not necessarily the function Stored Procedure (SP) defined, as we can find in most of other types of DBMS.
 
They are in fact, small sets of code stored at server side of a database.
 
On the contrary, to what happens in other databases, the Stored Procedures in PostgreSQL are defined as FUNCTIONS, as well as triggers, making this feature a bit more complicated, depending on its return type. These functions are important and variant in features, but created equal. Working with the creation of these small snippets of code is a good practice because it can leave quite complicated code acting on the server-side that can be used by multiple apps, thus avoiding the need to replicate them in each of these apps.
Advertisement