postgresql/src/include
Alvaro Herrera 24c0a6c649 logical replication: fix OID type mapping mechanism
The logical replication type map seems to have been misused by its only
caller -- it would try to use the remote OID as input for local type
routines, which unsurprisingly could result in bogus "cache lookup
failed for type XYZ" errors, or random other type names being picked up
if they happened to use the right OID.  Fix that, changing
Oid logicalrep_typmap_getid(Oid remoteid) to
char *logicalrep_typmap_gettypname(Oid remoteid)
which is more useful.  If the remote type is not part of the typmap,
this simply prints "unrecognized type" instead of choking trying to
figure out -- a pointless exercise (because the only input for that
comes from replication messages, which are not under the local node's
control) and dangerous to boot, when called from within an error context
callback.

Once that is done, it comes to light that the local OID in the typmap
entry was not being used for anything; the type/schema names are what we
need, so remove local type OID from that struct.

Once you do that, it becomes pointless to attach a callback to regular
syscache invalidation.  So remove that also.

Reported-by: Dang Minh Huong
Author: Masahiko Sawada
Reviewed-by: Álvaro Herrera, Petr Jelínek, Dang Minh Huong, Atsushi Torikoshi
Discussion: https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A6BE964@BPXM05GP.gisp.nec.co.jp
Discussion: https://postgr.es/m/75DB81BEEA95B445AE6D576A0A5C9E936A6C4B0A@BPXM05GP.gisp.nec.co.jp
2018-03-14 21:34:26 -03:00
..
access Remove redundant IndexTupleDSize macro. 2018-02-28 19:25:54 -05:00
bootstrap Update copyright for 2018 2018-01-02 23:30:12 -05:00
catalog Remove pg_class.relhaspkey 2018-03-14 15:31:34 -04:00
commands Support INOUT arguments in procedures 2018-03-14 12:07:28 -04:00
common Move strtoint() to common 2018-03-13 10:21:09 -04:00
datatype Update copyright for 2018 2018-01-02 23:30:12 -05:00
executor Support INOUT arguments in procedures 2018-03-14 12:07:28 -04:00
fe_utils Empty search_path in Autovacuum and non-psql/pgbench clients. 2018-02-26 07:39:44 -08:00
foreign Update copyright for 2018 2018-01-02 23:30:12 -05:00
lib Minor clean-up in dshash.{c,h}. 2018-03-01 16:25:46 -08:00
libpq Use abstracted SSL API in server connection log messages 2018-01-26 09:50:46 -05:00
mb Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Change internal integer representation of Value node 2018-03-13 09:56:25 -04:00
optimizer Fix improper uses of canonicalize_qual(). 2018-03-11 18:10:42 -04:00
parser Allow UNIQUE indexes on partitioned tables 2018-02-19 17:40:00 -03:00
port Remove outdated/removed Win32 URLs in C comments 2018-01-09 18:33:21 -05:00
portability Update copyright for 2018 2018-01-02 23:30:12 -05:00
postmaster Log when a BRIN autosummarization request fails 2018-03-14 11:59:40 -03:00
regex Update copyright for 2018 2018-01-02 23:30:12 -05:00
replication logical replication: fix OID type mapping mechanism 2018-03-14 21:34:26 -03:00
rewrite Update copyright for 2018 2018-01-02 23:30:12 -05:00
snowball Update copyright for 2018 2018-01-02 23:30:12 -05:00
statistics Update copyright for 2018 2018-01-02 23:30:12 -05:00
storage Fix crash when canceling parallel query 2018-02-16 16:21:24 -05:00
tcop Replace GrantObjectType with ObjectType 2018-01-19 14:01:14 -05:00
tsearch Update copyright for 2018 2018-01-02 23:30:12 -05:00
utils Fix assorted issues in convert_to_scalar(). 2018-03-03 20:31:35 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Fix StaticAssertExpr() under C++ 2018-02-18 22:28:11 -05:00
fmgr.h Remove prototype for fmgr() function, which no longer exists. 2018-02-07 08:42:36 -05:00
funcapi.h Support INOUT arguments in procedures 2018-03-14 12:07:28 -04:00
getaddrinfo.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
getopt_long.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Mark assorted GUC variables as PGDLLIMPORT. 2018-02-09 15:54:45 -05:00
pg_config.h.in Another attempt at fixing build with various OpenSSL versions 2018-01-04 19:09:27 -05:00
pg_config.h.win32 Fix up ecpg's configuration so it handles "long long int" in MSVC builds. 2018-02-27 16:46:52 -05: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.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_getopt.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_trace.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgstat.h Support parallel btree index builds. 2018-02-02 13:32:44 -05:00
pgtar.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgtime.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
port.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
postgres.h Move the extern declaration for ExceptionalCondition into c.h. 2018-02-14 19:43:33 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
rusagestub.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
windowapi.h Update copyright for 2018 2018-01-02 23:30:12 -05:00