postgresql/src/backend/commands
Robert Haas 76733b399c Avoid using a fake relcache entry to own an SmgrRelation.
If an error occurs before we close the fake relcache entry, the the
fake relcache entry will be destroyed by the SmgrRelation will
survive until end of transaction. Its smgr_owner pointer ends up
pointing to already-freed memory.

The original reason for using a fake relcache entry here was to try
to avoid reusing an SMgrRelation across a relevant invalidation. To
avoid that problem, just call smgropen() again each time we need a
reference to it. Hopefully someday we will come up with a more
elegant approach, but accessing uninitialized memory is bad so let's
do this for now.

Dilip Kumar, reviewed by Andres Freund and Tom Lane. Report by
Justin Pryzby.

Discussion: http://postgr.es/m/20220802175043.GA13682@telsasoft.com
Discussion: http://postgr.es/m/CAFiTN-vSFeE6_W9z698XNtFROOA_nSqUXWqLcG0emob_kJ+dEQ@mail.gmail.com
2022-08-12 08:25:41 -04:00
..
Makefile Move parallel vacuum code to vacuumparallel.c. 2021-12-23 11:42:52 +05:30
aggregatecmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
alter.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
amcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
analyze.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
async.c Revert the addition of GetMaxBackends() and related stuff. 2022-04-12 14:45:23 -04:00
cluster.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
collationcmds.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
comment.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
constraint.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
conversioncmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
copy.c Reject MERGE in CTEs and COPY 2022-08-12 12:05:50 +02:00
copyfrom.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
copyfromparse.c Fix two issues with HEADER MATCH in COPY 2022-06-23 10:49:20 +09:00
copyto.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
createas.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
dbcommands.c Avoid using a fake relcache entry to own an SmgrRelation. 2022-08-12 08:25:41 -04:00
define.c Improve two comments related to a boolean DefElem's value 2022-07-11 11:07:33 +09:00
discard.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
dropcmds.c Use list_copy_head() instead of list_truncate(list_copy(...), ...) 2022-07-13 15:03:47 +12:00
event_trigger.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
explain.c Fix formatting and comment typos 2022-08-04 16:41:29 +07:00
extension.c Fix missed corner cases for grantable permissions on GUCs. 2022-07-19 17:21:55 -04:00
foreigncmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
functioncmds.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
indexcmds.c Rework logic and simplify syntax of REINDEX DATABASE/SYSTEM 2022-07-19 11:45:06 +09:00
lockcmds.c Add support for security invoker views. 2022-03-22 10:28:10 +00:00
matview.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
opclasscmds.c Fix DDL deparse of CREATE OPERATOR CLASS 2022-05-20 18:52:55 +02:00
operatorcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
policy.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
portalcmds.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
prepare.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
proclang.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
publicationcmds.c Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
schemacmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
seclabel.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
sequence.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
statscmds.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
subscriptioncmds.c Refactor code in charge of grabbing the relations of a subscription 2022-07-27 19:50:06 +09:00
tablecmds.c Fix ENABLE/DISABLE TRIGGER to handle recursion correctly 2022-08-05 09:47:26 +02:00
tablespace.c Replace pgwin32_is_junction() with lstat(). 2022-08-06 12:50:59 +12:00
trigger.c Fix ENABLE/DISABLE TRIGGER to handle recursion correctly 2022-08-05 09:47:26 +02:00
tsearchcmds.c Add Boolean node 2022-01-17 10:38:23 +01:00
typecmds.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
user.c Fix brain fade in e530be2c5c. 2022-07-26 15:12:09 -04:00
vacuum.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
vacuumparallel.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
variable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
view.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00