...
Non-transient—In-place editing, packaging, and no archiving of database changes so they can be managed similar to application code. This applies to the following object types:
Procedures (- when scripts are placed in the
procedure
folder)Functions - when scripts are placed in the
function
folderViews (- when scripts are placed in the
view
folder)Triggers ( - when scripts are placed in the
trigger
folder)
Transient—Database changes are archived after packaging (all other folders).
Info |
---|
PostgreSQL packaging doesn't support Packager requires that stored logic scripts ( |
Objects and Packaging Folders
...
Operation and Object Type | Packaging Folders (fixed folders) | Package Methods (flexible folders) | Archived | Notes |
---|---|---|---|---|
CREATE/ALTER/DROP DATABASE LINK |
| direct | Yes | |
CREATE/ALTER/DROP FUNCTION |
| storedlogic | YesNo | |
CREATE/ALTER/DROP INDEX |
| convert, ddl_direct, direct | Yes | |
CREATE/ALTER/DROP PROCEDURE (not overloaded)* |
| storedlogic | No | In case, if procedure has multiple variants (is overloaded), use |
CREATE/ALTER/DROP QUEUE |
| direct | Yes | |
CREATE/ALTER/DROP SEQUENCE |
| convert, ddl_direct, direct | Yes | |
CREATE/ALTER/DROP SYNONYM |
| convert, ddl_direct, direct | Yes | For ALTER and CREATE OR REPLACE synonym use ddl_direct or sql_direct/direct. (Do not use ddl/convert with ALTER and CREATE OR REPLACE synonym.) |
CREATE/ALTER/DROP TABLE |
| convert, ddl_direct, direct | Yes | For PARTITIONED TABLE changes, use |
CREATE/ALTER/DROP TRIGGER |
| storedlogic | No | |
CREATE/ALTER/DROP TYPE |
| direct | Yes | |
CREATE/ALTER/DROP VIEW |
| storedlogic | No | |
CREATE/ALTER/DROP VIEW INDEX |
| convert, ddl_direct, direct | Yes | |
RENAME <DB_OBJECT> |
| direct | Yes |
...
Operation | Packaging Folder (fixed folders) | Package Method (flexible folders) | Archived |
---|---|---|---|
INSERT, UPDATE, DELETE, SELECT | data_dml | data_dml | Yes |
GRANT, REVOKE | sql_direct | direct | Yes |
Info |
---|
PostgreSQL Stored Logic recommendations
|
EnableRollbackOnError Support
Starting in 8.10, you can use enableRollbackOnError=true
. The implementation of this is slightly different compared to other clients.
It is enabled by:
Using
set ON_ERROR_STOP
toon
Wrapping SQL into transaction by adding
BEGIN;
andCOMMIT
Due to this approach, there are limitations:
Some SQL statements can’t be executed inside of transactions, such as create database, drop database, and reindex.
If you use your own transaction inside of a script, it may not work as expected. PostgreSQL ignores a
BEGIN
if one is already active, which may cause mismatched transaction scopes or errors.
Error Handling
Do not put error-handling statements in the SQL scripts.
...