|
62 | 62 | #include"access/htup_details.h"
|
63 | 63 | #include"catalog/indexing.h"
|
64 | 64 | #include"catalog/namespace.h"
|
| 65 | +#include"catalog/pg_constraint_fn.h" |
65 | 66 | #include"pglogical_output/hooks.h"
|
66 | 67 | #include"parser/analyze.h"
|
67 | 68 | #include"parser/parse_relation.h"
|
@@ -5179,6 +5180,23 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
|
5179 | 5180 | {
|
5180 | 5181 | MtmFinishDDLCommand();
|
5181 | 5182 | }
|
| 5183 | +if (nodeTag(parsetree)==T_CreateStmt) |
| 5184 | +{ |
| 5185 | +CreateStmt*create= (CreateStmt*)parsetree; |
| 5186 | +Oidrelid=RangeVarGetRelid(create->relation,NoLock, true); |
| 5187 | +if (relid!=InvalidOid) { |
| 5188 | +Oidconstraint_oid; |
| 5189 | +Bitmapset*pk=get_primary_key_attnos(relid, true,&constraint_oid); |
| 5190 | +if (pk==NULL) { |
| 5191 | +elog(WARNING, |
| 5192 | +MtmIgnoreTablesWithoutPk |
| 5193 | + ?"Table %s.%s without primary will not be replicated" |
| 5194 | + :"Updates and deletes of table %s.%s without primary will not be replicated", |
| 5195 | +create->relation->schemaname ?create->relation->schemaname :"public", |
| 5196 | +create->relation->relname); |
| 5197 | +} |
| 5198 | +} |
| 5199 | +} |
5182 | 5200 | }
|
5183 | 5201 |
|
5184 | 5202 | staticvoid
|
|