postgresql/src/include
Alexander Korotkov 04158e7fa3 Avoid repeated table name lookups in createPartitionTable()
Currently, createPartitionTable() opens newly created table using its name.
This approach is prone to privilege escalation attack, because we might end
up opening another table than we just created.

This commit address the issue above by opening newly created table by its
OID.  It appears to be tricky to get a relation OID out of ProcessUtility().
We have to extend TableLikeClause with new newRelationOid field, which is
filled within ProcessUtility() to be further accessed by caller.

Security: CVE-2014-0062
Reported-by: Noah Misch
Discussion: https://postgr.es/m/20240808171351.a9.nmisch%40google.com
Reviewed-by: Pavel Borisov, Dmitry Koval
2024-08-22 09:50:48 +03:00
..
access Give nbtree move right function internal linkage. 2024-08-12 14:36:55 -04:00
archive Add macro for customizing an archiving WARNING message. 2024-03-04 15:41:42 -06:00
backup Align blocks in incremental backups to BLCKSZ 2024-04-05 16:30:01 +02:00
bootstrap Update copyright for 2024 2024-01-03 20:49:05 -05:00
catalog Create syscache entries for pg_extension 2024-08-22 10:48:25 +09:00
commands Implement pg_wal_replay_wait() stored procedure 2024-08-02 21:16:56 +03:00
common Remove dependence on -fwrapv semantics in a few places. 2024-08-15 15:47:31 -05:00
datatype Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor Log the conflicts while applying changes in logical replication. 2024-08-20 08:35:11 +05:30
fe_utils Improve file header comments for astramer code. 2024-08-07 08:49:41 -04:00
foreign Clean up more indent breakage from 6377e12a5. 2024-04-16 13:00:40 -04:00
jit Move resowner from common JitContext to LLVM specific 2024-07-19 10:27:06 +03:00
lib Implement pg_wal_replay_wait() stored procedure 2024-08-02 21:16:56 +03:00
libpq Use PqMsg_* macros in more places. 2024-07-17 10:51:00 -05:00
mb Inline basic UTF-8 functions. 2024-03-20 09:40:57 -07:00
nodes Avoid repeated table name lookups in createPartitionTable() 2024-08-22 09:50:48 +03:00
optimizer Treat number of disabled nodes in a path as a separate cost metric. 2024-08-21 10:12:30 -04:00
parser Remove obsolete RECHECK keyword completely 2024-08-09 07:18:51 +02:00
partitioning Implement ALTER TABLE ... SPLIT PARTITION ... command 2024-04-07 01:18:44 +03:00
pch Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Require memory barrier support. 2024-07-30 23:01:55 +12:00
portability Fix datatypes in comments in instr_time.h 2024-08-06 22:15:55 +03:00
postmaster Apply PGDLLIMPORT markings to some GUC variables 2024-08-14 11:36:12 +02:00
regex Cope with <regex.h> name clashes. 2024-07-06 10:27:16 +12:00
replication Log the conflicts while applying changes in logical replication. 2024-08-20 08:35:11 +05:30
rewrite Support MERGE into updatable views. 2024-02-29 15:56:59 +00:00
snowball Update copyright for 2024 2024-01-03 20:49:05 -05:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage Apply PGDLLIMPORT markings to some GUC variables 2024-08-14 11:36:12 +02:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:33 -07:00
tsearch Constify fields and parameters in spell.c 2024-08-06 23:04:51 +03:00
utils Don't advance origin during apply failure. 2024-08-21 09:22:32 +05:30
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Add macro to disable address safety instrumentation 2024-04-06 12:20:40 +07:00
fmgr.h Remove _PG_fini() 2024-08-21 07:24:03 +09:00
funcapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
getopt_long.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
meson.build meson: Restore implicit warning/debug/optimize flags for extensions 2024-06-07 09:36:26 +02:00
miscadmin.h Use pgBufferUsage for buffer usage tracking in analyze. 2024-08-13 18:49:45 -07:00
pg_config.h.in All POSIX systems have langinfo.h and CODESET. 2024-08-13 22:13:52 +12:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Remove TRACE_SORT macro 2024-08-14 08:07:52 +02:00
pg_getopt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_trace.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstat.h Introduce pluggable APIs for Cumulative Statistics 2024-08-04 19:41:24 +09:00
pgtar.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtime.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
port.h Add port/ replacement for strsep() 2024-07-22 09:50:30 +02:00
postgres.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
varatt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
windowapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00