Creating a publication (createpub) v7
The createpub
command creates a publication.
Synopsis
The createpub
command adds a publication subordinate to the publication database definition with the publication database ID given by parameter pubdbid
. If the publication is designated as snapshot-only by setting parameter reptype
to s
, then any views listed after the views parameter are ignored.
See Adding a publication for more information on creating a publication for a single-master replication system. See Adding a publication for a multi-master replication system.
Note
The schema names, table names, and view names that you supply as values for the tables and views parameters are case sensitive. Unless quoted identifiers were used to build the database objects, you must enter Oracle names using uppercase letters (for example, EDB.DEPT
) and EDB Postgres Advanced Server names in lowercase letters (for example edb.dept
). See Quoted identifiers and default case translation for more information.
Parameters
pubname
The publication name to give to the new publication.
pubsvrfile
The file containing the publication server login information.
dbid
The publication database ID of the publication database definition the new publication is added as a subordinate. This createpub
command is applied to a single-master replication (SMR) or multi-master replication (MMR) system according to the Replication Group Type of this database.
-reptype
Specify s
for a snapshot-only publication. Specify t
if the publication is transactional (to allow synchronization replications).
-tables
or -alltables
Use these options to include tables into publication. If reptype
is t
(transactional), then you must include -tables
or -alltables
. Otherwise, these options are optional.
The -tables
option includes tables from the tables list to the publication. The -alltables
option allows you to include all tables of the database or only tables from the listed schemas (optional) to the publication.
-views or -allviews
For SMR and -reptype s (snapshot) only: Use these options to include views into publication.
The -views
option includes views from the views list to the publication. The -allviews
option allows you to include all views of the database or only views from the listed schemas (optional) to the publication.
schema_tn
The name of the schema containing the nth table of the tables parameter list or the name of the nth schema of the alltables
parameter list . This value is case sensitive.
table_n
The table name of the nth table in the tables parameter list. This value is case sensitive.
schema_vn
For SMR only: The name of the schema containing the nth view of the views parameter list or the name of the nth schema of the allviews
parameter list . This value is case sensitive.
view_n
For SMR only: View name of the nth view in the views parameter list. This value is case sensitive.
filtername_tn
The filter name to assign to the filter rule on the table.
filterclause_tn
The filter clause to apply to the table in the tables parameter list for the table indicated by schema_t1.table_tn
.
filtername_vn
The filter name to assign to the filter rule on the view.
filterclause_vn
For SMR only: The filter clause to apply to the view in the views parameter list for the table indicated by schema_v1.table_vn
.
-defaultconflictresolution
For MMR only: Default conflict resolution (E
, L
, N
, or M
), if the -conflictresolution
option is omitted. The default is E
.
-defaultstandbyconflictresolution
For MMR only: Default standby conflict resolution (E
, L
, N
, or M
), if the -standbyconflictresolution
option is omitted. The default is M
.
-conflictresolution
For MMR only: For the conflictresolution
option, specify one of these values:
E
for earliest timestamp conflict resolutionL
for latest timestamp conflict resolutionN
for node priority conflict resolutionM
for manual conflict resolutionC
for custom conflict handling
The specified conflict resolution applies to the table schema_tn.table_n
from the tables parameter list. The default is E
.
-standbyconflictresolution
For MMR only: For the standbyconflictresolution option
, specify one of these values:
E
for earliest timestamp conflict resolutionL
for latest timestamp conflict resolutionN
for node priority conflict resolutionM
for manual conflict resolutionC
for custom conflict handling
The specified conflict resolution applies to the table schema_tn.table_n
from the tables parameter list. The default is M
.
customhandler_tn
For MMR only: For the conflictresolution
option or the standbyconflictresolution
option, specify customhandler_tn
as the function name. Include an optional schema prefix (that is, formatted as schema.function_name
) as given in the CREATE FUNCTION
command for the custom conflict handling function created for the table schema_tn.table_n
from the tables parameter list. You must add the custom conflict handling function to the primary definition node. See Adding a custom conflict handling function for an example of adding the custom conflict handling function using PSQL. You must specify the custom handler name option only if you set the conflictresolution
or standbyconflictresolution
option for custom conflict handling by using the C
value.
Examples
This example creates a publication named dept_emp
that contains the EDB.DEPT and EDB.EMP tables of an Oracle database. The replication method is synchronization.
This example creates a publication named salesemp
that contains the EDB.SALESEMP
view of an Oracle database. The replication method is snapshot-only.
This example creates a publication named analysts_managers
that contains the edb.dept table and employees from the edb.emp table who are analysts or managers. The tables are in an EDB Postgres Advanced Server database. The replication method is snapshot-only.
This example creates a publication for a multi-master replication system. One table filter is defined on table edb.dept, and three table filters are defined on the table edb.emp. Table edb.dept is assigned node priority conflict resolution and latest timestamp as the standby conflict resolution strategy. Table edb.emp is assigned earliest timestamp conflict resolution and manual resolution (the default) as its standby strategy.
- On this page
- Synopsis
- Parameters
- Examples