From: Heikki Linnakangas Date: Mon, 20 Apr 2015 09:30:30 +0000 (+0300) Subject: Remove serial_seqam GUC. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d6a36d02ddf6943fb93bb6b5308035ff556f9431;p=users%2Fheikki%2Fpostgres.git Remove serial_seqam GUC. --- diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index ce401067b9..b30c68dc13 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -5671,27 +5671,6 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; - - serial_sequenceam (string) - - serial_sequenceam configuration parameter - - sequence access methodserial - - - - This variable specifies the default sequence access method to be used - for SERIAL and BIGSERIAL. - - - - The default is 'local' sequence access method. If the value does not - match the name of any existing sequence access method, an error will be - raised. - - - - check_function_bodies (boolean) diff --git a/src/backend/access/sequence/seqam.c b/src/backend/access/sequence/seqam.c index 6292a1b96a..880b6da5a3 100644 --- a/src/backend/access/sequence/seqam.c +++ b/src/backend/access/sequence/seqam.c @@ -72,8 +72,6 @@ #include "utils/rel.h" #include "utils/syscache.h" -char *serial_seqam = NULL; - #define GET_SEQAM_PROCEDURE(pname, missing_ok) \ do { \ procedure = &seqrel->rd_aminfo->pname; \ @@ -310,42 +308,6 @@ seqam_set_state(Relation seqrel, SequenceHandle *seqh, char **keys, *------------------------------------------------------------ */ -/* check_hook: validate new serial_seqam value */ -bool -check_serial_seqam(char **newval, void **extra, GucSource source) -{ - /* - * If we aren't inside a transaction, we cannot do database access so - * cannot verify the name. Must accept the value on faith. - */ - if (IsTransactionState()) - { - if (!OidIsValid(get_seqam_oid(*newval, true))) - { - /* - * When source == PGC_S_TEST, we are checking the argument of an - * ALTER DATABASE SET or ALTER USER SET command. Value may - * be created later. Because of that, issue a NOTICE if source == - * PGC_S_TEST, but accept the value anyway. - */ - if (source == PGC_S_TEST) - { - ereport(NOTICE, - (errcode(ERRCODE_UNDEFINED_OBJECT), - errmsg("sequence access method \"%s\" does not exist", - *newval))); - } - else - { - GUC_check_errdetail("sequence access method \"%s\" does not exist.", - *newval); - return false; - } - } - } - return true; -} - /* * get_seqam_oid - given a sequence AM name, look up the OID diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index dce6566ee8..9832384be8 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -406,7 +406,7 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column) seqstmt->sequence = makeRangeVar(snamespace, sname, -1); seqstmt->options = NIL; seqstmt->amoptions = NIL; - seqstmt->accessMethod = serial_seqam; + seqstmt->accessMethod = NULL; /* * If this is ALTER ADD COLUMN, make sure the sequence will be owned diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 1d31ceaef5..8ab513d615 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2894,17 +2894,6 @@ static struct config_string ConfigureNamesString[] = check_default_tablespace, NULL, NULL }, - { - {"serial_sequenceam", PGC_USERSET, CLIENT_CONN_STATEMENT, - gettext_noop("Sets the default sequence access method for SERIAL and BIGSERIAL column types."), - gettext_noop("Defaults to 'local' sequence access method."), - GUC_IS_NAME - }, - &serial_seqam, - "local", - check_serial_seqam, NULL, NULL - }, - { {"temp_tablespaces", PGC_USERSET, CLIENT_CONN_STATEMENT, gettext_noop("Sets the tablespace(s) to use for temporary tables and sort files."), diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index a90637b05b..110983f176 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -512,7 +512,6 @@ #default_tablespace = '' # a tablespace name, '' uses the default #temp_tablespaces = '' # a list of tablespace names, '' uses # only default tablespace -#serial_sequenceam = 'local' # default sequence access method for SERIAL #check_function_bodies = on #default_transaction_isolation = 'read committed' #default_transaction_read_only = off diff --git a/src/include/access/seqam.h b/src/include/access/seqam.h index e53f1abd72..0ce2bd1590 100644 --- a/src/include/access/seqam.h +++ b/src/include/access/seqam.h @@ -26,8 +26,6 @@ struct SequenceHandle; typedef struct SequenceHandle SequenceHandle; -extern char *serial_seqam; - extern void seqam_init(Oid seqamid, Oid seqrelid, List *seqparams, List *reloptions, Datum *values, bool *nulls); extern int64 seqam_alloc(Relation seqrel, SequenceHandle *seqh, diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 1ac3ef73f7..ff78b70b96 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -410,7 +410,6 @@ extern void GUC_check_errcode(int sqlerrcode); */ /* in commands/tablespace.c */ -extern bool check_serial_seqam(char **newval, void **extra, GucSource source); extern bool check_default_tablespace(char **newval, void **extra, GucSource source); extern bool check_temp_tablespaces(char **newval, void **extra, GucSource source); extern void assign_temp_tablespaces(const char *newval, void *extra);