git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 344b7e1) | patch
Harden tableam against nonexistant / wrong kind of AMs.
Fri, 5 Apr 2019 00:17:50 +0000 (17:17 -0700)
Fri, 5 Apr 2019 00:39:39 +0000 (17:39 -0700)
commit ea97e440b8570ffd1a6cd6604f2ef882c0a72291
Harden tableam against nonexistant / wrong kind of AMs.

Previously it was allowed to set default_table_access_method to an
empty string. That makes sense for default_tablespace, where that was
copied from, as it signals falling back to the database's default
tablespace. As there is no equivalent for table AMs, forbid that.

Also make sure to throw a usable error when creating a table using an
index AM, by using get_am_type_oid() to implement get_table_am_oid()
instead of a separate copy. Previously we'd error out only later, in
GetTableAmRoutine().

Thirdly remove GetTableAmRoutineByAmId() - it was only used in an
earlier version of 8586bf7ed8.

Add tests for the above (some for index AMs as well).
src/backend/access/table/tableamapi.c diff | blob | blame | history
src/backend/commands/amcmds.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/include/access/tableam.h diff | blob | blame | history
src/include/commands/defrem.h diff | blob | blame | history
src/test/regress/expected/create_am.out diff | blob | blame | history
src/test/regress/expected/type_sanity.out diff | blob | blame | history
src/test/regress/sql/create_am.sql diff | blob | blame | history
src/test/regress/sql/type_sanity.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /