
A transaction is the propagation of one or more changes to the database.įor example, if you are creating or updating or deleting a record from the table, then you are performing transaction on the table. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program. If the level is not specified, the defaults level will be EXCEPTION that raises an error and stops the current transaction.Ī transaction is a unit of work that is performed against a database. The configuration of these error messages are controlled by the client_min_messages and log_min_messages configuration parameters. The error RAISE LOG and RAISE DEBUG error messages are not returned in the client side, that’s because those messages are not showed to the client by default, they areĭisplayed in the server side. To call the created function you could use: The function has a result that changes the result even when you write the same input values. IMMUTABLE: The function ensures the same result (it caches it) if the same value is put as an input arguments.The function is not evaluated and returns a NULL value. STRICT: write STRICT when the input arguments have NULL values.

The conditions can be STRICT, IMMUTABLE or VOLATILE. Indicate the procedural language of the function.Place the block of code inside inside the BEGIN and END.RETURNS specifies the return type of the function.Provide a list of parameters inside the paretheses, also specifying each data type (integer, boolean, geometry, etc.).We specify the name of function followed by the CREATE FUNCTIONclause.CREATE FUNCTION function_name ( argument1 type, argument2 type ) RETURNS type AS BEGIN staments END LANGUAGE 'language_name'
