aboutsummaryrefslogtreecommitdiff
path: root/src/include/access
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-04-11 15:46:35 +0300
committerAlexander Korotkov <akorotkov@postgresql.org>2024-04-11 15:46:35 +0300
commitbc1e2092ebb857802a9713d0d3588079e2f0216a (patch)
treef55adc80b07150bcd7f5cbd50a9bfc89b3f301d6 /src/include/access
parent87840b9741864dfdb9f63b0056e2783cdb49b8a5 (diff)
downloadpostgresql-bc1e2092ebb857802a9713d0d3588079e2f0216a.tar.gz
postgresql-bc1e2092ebb857802a9713d0d3588079e2f0216a.zip
Revert: Custom reloptions for table AM
This commit reverts 9bd99f4c26 and 422041542f per review by Andres Freund. Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de
Diffstat (limited to 'src/include/access')
-rw-r--r--src/include/access/reloptions.h11
-rw-r--r--src/include/access/tableam.h50
2 files changed, 4 insertions, 57 deletions
diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h
index a3560500f36..81829b8270a 100644
--- a/src/include/access/reloptions.h
+++ b/src/include/access/reloptions.h
@@ -21,7 +21,6 @@
#include "access/amapi.h"
#include "access/htup.h"
-#include "access/tableam.h"
#include "access/tupdesc.h"
#include "nodes/pg_list.h"
#include "storage/lock.h"
@@ -225,9 +224,7 @@ extern Datum transformRelOptions(Datum oldOptions, List *defList,
bool acceptOidsOff, bool isReset);
extern List *untransformRelOptions(Datum options);
extern bytea *extractRelOptions(HeapTuple tuple, TupleDesc tupdesc,
- const TableAmRoutine *tableam,
- amoptions_function amoptions,
- CommonRdOptions *common);
+ amoptions_function amoptions);
extern void *build_reloptions(Datum reloptions, bool validate,
relopt_kind kind,
Size relopt_struct_size,
@@ -236,9 +233,9 @@ extern void *build_reloptions(Datum reloptions, bool validate,
extern void *build_local_reloptions(local_relopts *relopts, Datum options,
bool validate);
-extern void fill_default_common_reloptions(CommonRdOptions *common);
-extern bytea *heap_reloptions(char relkind, Datum reloptions,
- CommonRdOptions *common, bool validate);
+extern bytea *default_reloptions(Datum reloptions, bool validate,
+ relopt_kind kind);
+extern bytea *heap_reloptions(char relkind, Datum reloptions, bool validate);
extern bytea *view_reloptions(Datum reloptions, bool validate);
extern bytea *partitioned_table_reloptions(Datum reloptions, bool validate);
extern bytea *index_reloptions(amoptions_function amoptions, Datum reloptions,
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h
index d1cd71b7a17..a07f250b462 100644
--- a/src/include/access/tableam.h
+++ b/src/include/access/tableam.h
@@ -746,34 +746,6 @@ typedef struct TableAmRoutine
int32 slicelength,
struct varlena *result);
- /*
- * This callback parses and validates the reloptions array for a table.
- *
- * This is called only when a non-null reloptions array exists for the
- * table. 'reloptions' is a text array containing entries of the form
- * "name=value". The function should construct a bytea value, which will
- * be copied into the rd_options field of the table's relcache entry. The
- * data contents of the bytea value are open for the access method to
- * define.
- *
- * The '*common' represents the common values, which the table access
- * method exposes for autovacuum, query planner, and others. The caller
- * should fill them with default values. The table access method may
- * modify them on the base of options specified by a user.
- *
- * When 'validate' is true, the function should report a suitable error
- * message if any of the options are unrecognized or have invalid values;
- * when 'validate' is false, invalid entries should be silently ignored.
- * ('validate' is false when loading options already stored in pg_catalog;
- * an invalid entry could only be found if the access method has changed
- * its rules for options, and in that case ignoring obsolete entries is
- * appropriate.)
- *
- * It is OK to return NULL if default behavior is wanted.
- */
- bytea *(*reloptions) (char relkind, Datum reloptions,
- CommonRdOptions *common, bool validate);
-
/* ------------------------------------------------------------------------
* Planner related functions.
@@ -1986,27 +1958,6 @@ table_relation_fetch_toast_slice(Relation toastrel, Oid valueid,
result);
}
-/*
- * Parse table options without knowledge of particular table.
- */
-static inline bytea *
-tableam_reloptions(const TableAmRoutine *tableam, char relkind,
- Datum reloptions, CommonRdOptions *common, bool validate)
-{
- return tableam->reloptions(relkind, reloptions, common, validate);
-}
-
-/*
- * Parse options for given table.
- */
-static inline bytea *
-table_reloptions(Relation rel, char relkind,
- Datum reloptions, CommonRdOptions *common, bool validate)
-{
- return tableam_reloptions(rel->rd_tableam, relkind, reloptions,
- common, validate);
-}
-
/* ----------------------------------------------------------------------------
* Planner related functionality
@@ -2185,7 +2136,6 @@ extern void table_block_relation_estimate_size(Relation rel,
*/
extern const TableAmRoutine *GetTableAmRoutine(Oid amhandler);
-extern const TableAmRoutine *GetTableAmRoutineByAmOid(Oid amoid);
/* ----------------------------------------------------------------------------
* Functions in heapam_handler.c