|
56 | 56 | #include"rewrite/rewriteManip.h" |
57 | 57 | #include"utils/acl.h" |
58 | 58 | #include"utils/builtins.h" |
59 | | -#include"utils/guc.h" |
60 | 59 | #include"utils/lsyscache.h" |
61 | 60 | #include"utils/rel.h" |
62 | 61 | #include"utils/syscache.h" |
@@ -223,7 +222,7 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString) |
223 | 222 | cxt.blist=NIL; |
224 | 223 | cxt.alist=NIL; |
225 | 224 | cxt.pkey=NULL; |
226 | | -cxt.hasoids=default_with_oids; |
| 225 | +cxt.hasoids=interpretOidsOption(stmt->options, true); |
227 | 226 |
|
228 | 227 | Assert(!stmt->ofTypename|| !stmt->inhRelations);/* grammar enforces */ |
229 | 228 |
|
@@ -282,17 +281,6 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString) |
282 | 281 | * Output results. |
283 | 282 | */ |
284 | 283 | stmt->tableElts=cxt.columns; |
285 | | -/* |
286 | | - * Add WITH/WITHOUT OIDS, if necessary. A literal statement-specified |
287 | | - * WITH/WITHOUT OIDS will still take precedence because the first |
288 | | - * matching "oids" in "options" is used. |
289 | | - */ |
290 | | -if (cxt.hasoids&& !interpretOidsOption(stmt->options, true)) |
291 | | -stmt->options=lappend(stmt->options,makeDefElem("oids", |
292 | | -(Node*)makeInteger(TRUE))); |
293 | | -elseif (!cxt.hasoids&&interpretOidsOption(stmt->options, true)) |
294 | | -stmt->options=lappend(stmt->options,makeDefElem("oids", |
295 | | -(Node*)makeInteger(FALSE))); |
296 | 284 | stmt->constraints=cxt.ckconstraints; |
297 | 285 |
|
298 | 286 | result=lappend(cxt.blist,stmt); |
@@ -861,8 +849,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla |
861 | 849 | } |
862 | 850 | } |
863 | 851 |
|
864 | | -cxt->hasoids=relation->rd_rel->relhasoids; |
865 | | - |
866 | 852 | /* |
867 | 853 | * Copy CHECK constraints if requested, being careful to adjust attribute |
868 | 854 | * numbers so they match the child. |
|