pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Custom reloptions for table AM
4+ messages / 3 participants
[nested] [flat]
* pgsql: Custom reloptions for table AM
@ 2024-03-30 20:54 Alexander Korotkov <akorotkov@postgresql.org>
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Korotkov @ 2024-03-30 20:54 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Custom reloptions for table AM
Let table AM define custom reloptions for its tables. This allows to
specify AM-specific parameters by WITH clause when creating a table.
The code may use some parts from prior work by Hao Wu.
Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com
Discussion: https://postgr.es/m/AMUA1wBBBxfc3tKRLLdU64rb.1.1683276279979.Hmail.wuhao%40hashdata.cn
Reviewed-by: Reviewed-by: Pavel Borisov, Matthias van de Meent
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c95c25f9af4bc77f2f66a587735c50da08c12b37
Modified Files
--------------
src/backend/access/common/reloptions.c | 6 ++--
src/backend/access/heap/heapam_handler.c | 12 +++++++
src/backend/access/table/tableamapi.c | 25 +++++++++++++++
src/backend/commands/tablecmds.c | 55 +++++++++++++++++++-------------
src/backend/postmaster/autovacuum.c | 4 ++-
src/backend/utils/cache/relcache.c | 6 +++-
src/include/access/reloptions.h | 2 ++
src/include/access/tableam.h | 43 +++++++++++++++++++++++++
8 files changed, 126 insertions(+), 27 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Custom reloptions for table AM
@ 2024-04-08 08:23 Alexander Korotkov <akorotkov@postgresql.org>
2024-04-08 09:02 ` Re: pgsql: Custom reloptions for table AM Thomas Munro <thomas.munro@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Korotkov @ 2024-04-08 08:23 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Custom reloptions for table AM
Let table AM define custom reloptions for its tables. This allows specifying
AM-specific parameters by the WITH clause when creating a table.
The reloptions, which could be used outside of table AM, are now extracted
into the CommonRdOptions data structure. These options could be by decision
of table AM directly specified by a user or calculated in some way.
The new test module test_tam_options evaluates the ability to set up custom
reloptions and calculate fields of CommonRdOptions on their base.
The code may use some parts from prior work by Hao Wu.
Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com
Discussion: https://postgr.es/m/AMUA1wBBBxfc3tKRLLdU64rb.1.1683276279979.Hmail.wuhao%40hashdata.cn
Reviewed-by: Reviewed-by: Pavel Borisov, Matthias van de Meent, Jess Davis
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9bd99f4c26fe37b8ee2f199aa868a0e2fdba4c43
Modified Files
--------------
src/backend/access/common/reloptions.c | 121 ++++++++++++-----
src/backend/access/heap/heapam.c | 4 +-
src/backend/access/heap/heapam_handler.c | 13 ++
src/backend/access/heap/heaptoast.c | 9 +-
src/backend/access/heap/hio.c | 4 +-
src/backend/access/heap/pruneheap.c | 4 +-
src/backend/access/heap/rewriteheap.c | 4 +-
src/backend/access/table/tableam.c | 2 +-
src/backend/access/table/tableamapi.c | 25 ++++
src/backend/commands/createas.c | 13 +-
src/backend/commands/tablecmds.c | 63 +++++----
src/backend/commands/vacuum.c | 8 +-
src/backend/postmaster/autovacuum.c | 12 +-
src/backend/tcop/utility.c | 28 +++-
src/backend/utils/cache/relcache.c | 73 +++++++++-
src/include/access/reloptions.h | 10 +-
src/include/access/tableam.h | 50 +++++++
src/include/utils/rel.h | 148 +++++++++++----------
src/test/modules/Makefile | 1 +
src/test/modules/meson.build | 1 +
src/test/modules/test_tam_options/.gitignore | 4 +
src/test/modules/test_tam_options/Makefile | 23 ++++
.../test_tam_options/expected/test_tam_options.out | 36 +++++
src/test/modules/test_tam_options/meson.build | 33 +++++
.../test_tam_options/sql/test_tam_options.sql | 25 ++++
.../test_tam_options/test_tam_options--1.0.sql | 12 ++
.../modules/test_tam_options/test_tam_options.c | 66 +++++++++
.../test_tam_options/test_tam_options.control | 4 +
src/tools/pgindent/typedefs.list | 4 +-
29 files changed, 639 insertions(+), 161 deletions(-)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Custom reloptions for table AM
2024-04-08 08:23 pgsql: Custom reloptions for table AM Alexander Korotkov <akorotkov@postgresql.org>
@ 2024-04-08 09:02 ` Thomas Munro <thomas.munro@gmail.com>
2024-04-08 09:11 ` Re: pgsql: Custom reloptions for table AM Alexander Korotkov <aekorotkov@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Munro @ 2024-04-08 09:02 UTC (permalink / raw)
To: Alexander Korotkov <akorotkov@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org
Hi Alexander,
I think this is uninitialised memory:
../pgsql/src/backend/postmaster/autovacuum.c:2988:33: runtime error:
load of value 80, which is not a valid value for type '_Bool'
#0 0x56010b3b6e47 in relation_needs_vacanalyze
../pgsql/src/backend/postmaster/autovacuum.c:2988
#1 0x56010b3b7745 in do_autovacuum
../pgsql/src/backend/postmaster/autovacuum.c:2023
#2 0x56010b3ba1a3 in AutoVacWorkerMain
../pgsql/src/backend/postmaster/autovacuum.c:1569
#3 0x56010b3c0aa6 in postmaster_child_launch
../pgsql/src/backend/postmaster/launch_backend.c:265
#4 0x56010b3c36b4 in StartChildProcess
../pgsql/src/backend/postmaster/postmaster.c:3928
#5 0x56010b3c6775 in StartAutovacuumWorker
../pgsql/src/backend/postmaster/postmaster.c:3997
#6 0x56010b3c6775 in process_pm_pmsignal
../pgsql/src/backend/postmaster/postmaster.c:3809
#7 0x56010b3c6775 in ServerLoop
../pgsql/src/backend/postmaster/postmaster.c:1667
#8 0x56010b3c8ca5 in PostmasterMain
../pgsql/src/backend/postmaster/postmaster.c:1372
#9 0x56010b1f458e in main ../pgsql/src/backend/main/main.c:197
#10 0x7f23b7e456c9 in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
#11 0x7f23b7e45784 in __libc_start_main_impl ../csu/libc-start.c:360
#12 0x56010ad5a270 in _start
(/home/bf/bf-build/tamandua/HEAD/pgsql.build/tmp_install/home/bf/bf-build/tamandua/HEAD/inst/bin/postgres+0x8b3270)
(BuildId: 17e96a9e15a2c22c2062d2cefc7586aaea64b144)
Or from CI:
../src/backend/postmaster/autovacuum.c:2988:33: runtime error: load of
value 26, which is not a valid value for type '_Bool'
==43234==Using libbacktrace symbolizer.
#0 0x556ee56de975 in relation_needs_vacanalyze
../src/backend/postmaster/autovacuum.c:2988
#1 0x556ee56df9e0 in do_autovacuum
../src/backend/postmaster/autovacuum.c:2023
#2 0x556ee56e1ada in AutoVacWorkerMain
../src/backend/postmaster/autovacuum.c:1569
#3 0x556ee56e8175 in postmaster_child_launch
../src/backend/postmaster/launch_backend.c:265
#4 0x556ee56ea1f3 in StartChildProcess
../src/backend/postmaster/postmaster.c:3928
#5 0x556ee56ede6f in StartAutovacuumWorker
../src/backend/postmaster/postmaster.c:3997
#6 0x556ee56ee3b0 in process_pm_pmsignal
../src/backend/postmaster/postmaster.c:3809
#7 0x556ee56ee889 in ServerLoop ../src/backend/postmaster/postmaster.c:1667
#8 0x556ee56f0478 in PostmasterMain
../src/backend/postmaster/postmaster.c:1372
#9 0x556ee550fb70 in main ../src/backend/main/main.c:197
#10 0x7f81c899cd09 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
#11 0x556ee505f249 in _start
(/tmp/cirrus-ci-build/build/tmp_install/usr/local/pgsql/bin/postgres+0x8ea249)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pgsql: Custom reloptions for table AM
2024-04-08 08:23 pgsql: Custom reloptions for table AM Alexander Korotkov <akorotkov@postgresql.org>
2024-04-08 09:02 ` Re: pgsql: Custom reloptions for table AM Thomas Munro <thomas.munro@gmail.com>
@ 2024-04-08 09:11 ` Alexander Korotkov <aekorotkov@gmail.com>
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Korotkov @ 2024-04-08 09:11 UTC (permalink / raw)
To: Thomas Munro <thomas.munro@gmail.com>; +Cc: Alexander Korotkov <akorotkov@postgresql.org>; pgsql-committers@lists.postgresql.org
Hi, Thomas!
On Mon, Apr 8, 2024 at 12:03 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> I think this is uninitialised memory:
I'm already working on this. Will be fixed in 10-15 minutes.
------
Regards,
Alexander Korotkov
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2024-04-08 09:11 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-30 20:54 pgsql: Custom reloptions for table AM Alexander Korotkov <akorotkov@postgresql.org>
2024-04-08 08:23 pgsql: Custom reloptions for table AM Alexander Korotkov <akorotkov@postgresql.org>
2024-04-08 09:02 ` Thomas Munro <thomas.munro@gmail.com>
2024-04-08 09:11 ` Alexander Korotkov <aekorotkov@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox