diff options
author | Thomas Munro <tmunro@postgresql.org> | 2021-10-26 12:54:55 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2021-10-26 12:54:55 +1300 |
commit | 8781b0ce25e702ba4a4f032d00da7acdef8dbfe1 (patch) | |
tree | 3c67d575dfe80a909194cc3a57f04be3c2c2adf2 /src/backend/port/sysv_shmem.c | |
parent | a030a0c5ccb113ccd09d0f0b82f1edb5e49ed607 (diff) | |
download | postgresql-8781b0ce25e702ba4a4f032d00da7acdef8dbfe1.tar.gz |
Reject huge_pages=on if shared_memory_type=sysv.
It doesn't work (it could, but hasn't been implemented).
Back-patch to 12, where shared_memory_type arrived.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/163271880203.22789.1125998876173795966@wrigleys.postgresql.org
Diffstat (limited to 'src/backend/port/sysv_shmem.c')
-rw-r--r-- | src/backend/port/sysv_shmem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c index cd385c4df6..e7474cee59 100644 --- a/src/backend/port/sysv_shmem.c +++ b/src/backend/port/sysv_shmem.c @@ -703,6 +703,12 @@ PGSharedMemoryCreate(Size size, errmsg("huge pages not supported on this platform"))); #endif + /* For now, we don't support huge pages in SysV memory */ + if (huge_pages == HUGE_PAGES_ON && shared_memory_type != SHMEM_TYPE_MMAP) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("huge pages not supported with the current shared_memory_type setting"))); + /* Room for a header? */ Assert(size > MAXALIGN(sizeof(PGShmemHeader))); |