1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

This patch adds a new GUC var, "default_with_oids", which follows the

proposal for eventually deprecating OIDs on user tables that I posted
earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or
WITHOUT OIDS when dumping a table. The documentation has been updated.

Neil Conway
This commit is contained in:
Bruce Momjian
2003-12-01 22:08:02 +00:00
parent e7ca867485
commit 7ce9b7c0d8
18 changed files with 218 additions and 90 deletions

View File

@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.222 2003/11/29 19:51:48 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.223 2003/12/01 22:07:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -43,6 +43,7 @@
#include "optimizer/var.h"
#include "parser/parsetree.h"
#include "utils/acl.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
@@ -593,11 +594,12 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
do_select_into = true;
/*
* For now, always create OIDs in SELECT INTO; this is for
* backwards compatibility with pre-7.3 behavior. Eventually we
* might want to allow the user to choose.
* The presence of OIDs in the result set of SELECT INTO is
* controlled by the default_with_oids GUC parameter. The
* behavior in versions of PostgreSQL prior to 7.5 is to
* always include OIDs.
*/
estate->es_force_oids = true;
estate->es_force_oids = default_with_oids;
}
/*

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.440 2003/11/29 19:51:51 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.441 2003/12/01 22:07:58 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -63,6 +63,7 @@
#include "utils/numeric.h"
#include "utils/datetime.h"
#include "utils/date.h"
#include "utils/guc.h"
extern List *parsetree; /* final parse result is delivered here */
@@ -1822,7 +1823,12 @@ OptInherit: INHERITS '(' qualified_name_list ')' { $$ = $3; }
OptWithOids:
WITH OIDS { $$ = TRUE; }
| WITHOUT OIDS { $$ = FALSE; }
| /*EMPTY*/ { $$ = TRUE; }
/*
* If the user didn't explicitely specify WITH or WITHOUT
* OIDS, decide whether to include OIDs based on the
* "default_with_oids" GUC var
*/
| /*EMPTY*/ { $$ = default_with_oids; }
;
OnCommitOption: ON COMMIT DROP { $$ = ONCOMMIT_DROP; }

View File

@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.173 2003/12/01 03:55:21 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.174 2003/12/01 22:08:00 momjian Exp $
*
*--------------------------------------------------------------------
*/
@@ -126,6 +126,8 @@ bool Australian_timezones = false;
bool Password_encryption = true;
bool default_with_oids = true;
int log_min_error_statement = PANIC;
int log_min_messages = NOTICE;
int client_min_messages = NOTICE;
@@ -263,7 +265,7 @@ const char *const config_group_names[] =
/* QUERY_TUNING */
gettext_noop("Query Tuning"),
/* QUERY_TUNING_METHOD */
gettext_noop("Query Tuning / Planner Method Enabling"),
gettext_noop("Query Tuning / Planner Method Configuration"),
/* QUERY_TUNING_COST */
gettext_noop("Query Tuning / Planner Cost Constants"),
/* QUERY_TUNING_GEQO */
@@ -831,6 +833,14 @@ static struct config_bool ConfigureNamesBool[] =
&check_function_bodies,
true, NULL, NULL
},
{
{"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
gettext_noop("By default, newly-created tables should have OIDs"),
NULL
},
&default_with_oids,
true, NULL, NULL
},
/* End-of-list marker */
{

View File

@@ -100,7 +100,7 @@
# QUERY TUNING
#---------------------------------------------------------------------------
# - Planner Method Enabling -
# - Planner Method Configuration -
#enable_hashagg = true
#enable_hashjoin = true
@@ -255,6 +255,7 @@
#add_missing_from = true
#regex_flavor = advanced # advanced, extended, or basic
#sql_inheritance = true
#default_with_oids = true
# - Other Platforms & Clients -