Re: Binary support for pgoutput plugin
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dave Cramer <davecramer@gmail.com>, Daniel Gustafsson <daniel@yesql.se>, Petr Jelinek <petr@2ndquadrant.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Michael Paquier <michael@paquier.xyz>, Dmitry Dolgov <9erthalion6@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Petr Jelinek <petr.jelinek@2ndquadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-07-15T02:47:53Z
Lists: pgsql-hackers
Hi, On 2020-07-14 22:28:48 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > What is the gain in having these checks? recv functions need to be safe > > against arbitrary input, so a type crosscheck doesn't buy additional > > safety in that regard. Not that a potential attacker couldn't just > > change the content anyways? > > You're confusing security issues with user-friendliness issues. > Detecting that you sent the wrong type via an OID mismatch error > is a lot less painful than trying to figure out why you've got > errors along the line of "incorrect binary data format". An oid mismatch error without knowing what that's about isn't very helpful either. How about adding an errcontext that shows the "source type oid", the target type oid & type name and, for records, the column name of the target table? That'd make this a lot easier to debug. Greetings, Andres Freund
Commits
-
Weaken type-OID-matching checks in array_recv and record_recv.
- 670c0a1d474b 14.0 landed
-
Fix construction of updated-columns bitmap in logical replication.
- e8de627a3e05 11.9 landed
- d5daae47db5e 14.0 landed
- 71e561bd4bc2 12.4 landed
- 39d6aec1927c 10.14 landed
- 2f1f189cf880 13.0 landed
-
Allow logical replication to transfer data in binary format.
- 9de77b545313 14.0 landed
-
Phase 2 pgindent run for v12.
- 8255c7a5eeba 12.0 cited