...
Do not qualify objects with the database name as PostgreSQL connections represent one database at a time.
For a Single-Schema project, you don’t need to qualify object names with the schema name. If they are not qualified, Datical DB uses the default schema if it is specified.
For a Multi-Schema project, you must qualify object names with the schema name so they get deployed to the correct schema during packaging.You can
Some objects, eg. triggers, do not allow schema qualification when creating the object. In this case you must use the
schemaName
attribute in themetadata.properties
file for a schema-level folder to specify the
schema. See Using the metadata.properties file.
Schema-level folder for schemaA
PostgreSQL SCM Packaging Patterns
...
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) folderFunctions - 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
Use the specified folder for listed PostgreSQL database operations.
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 |
sql_direct
|
storedlogic |
No | ||||
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), please 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
We also recommend to commit the trigger function script first and then the trigger script to avoid the ‘no such function exist’ error while running the packager. |
Rollback Handling
args are inputs in DAT-17177
Functions and Triggers avoid this by: put explanation
We recommend using a different name.
Error Handling
Do not put error-handling statements in the SQL scripts.
...