</listitem>
</varlistentry>
- <varlistentry id="guc-serial-sequenceam" xreflabel="serial_sequenceam">
- <term><varname>serial_sequenceam</varname> (<type>string</type>)
- <indexterm>
- <primary><varname>serial_sequenceam</> configuration parameter</primary>
- </indexterm>
- <indexterm><primary>sequence access method</><secondary>serial</></>
- </term>
- <listitem>
- <para>
- This variable specifies the default sequence access method to be used
- for <type>SERIAL</> and <type>BIGSERIAL</>.
- </para>
-
- <para>
- 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.
- </para>
- </listitem>
- </varlistentry>
-
<varlistentry id="guc-check-function-bodies" xreflabel="check_function_bodies">
<term><varname>check_function_bodies</varname> (<type>boolean</type>)
<indexterm>
#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; \
*------------------------------------------------------------
*/
-/* 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
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
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."),
#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
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,
*/
/* 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);