postgresql/src/backend/commands
Robert Haas 10c0558ffe Fix several mistakes around parallel workers and client_encoding.
Previously, workers sent data to the leader using the client encoding.
That mostly worked, but the leader the converted the data back to the
server encoding.  Since not all encoding conversions are reversible,
that could provoke failures.  Fix by using the database encoding for
all communication between worker and leader.

Also, while temporary changes to GUC settings, as from the SET clause
of a function, are in general OK for parallel query, changing
client_encoding this way inside of a parallel worker is not OK.
Previously, that would have confused the leader; with these changes,
it would not confuse the leader, but it wouldn't do anything either.
So refuse such changes in parallel workers.

Also, the previous code naively assumed that when it received a
NotifyResonse from the worker, it could pass that directly back to the
user.  But now that worker-to-leader communication always uses the
database encoding, that's clearly no longer correct - though,
actually, the old way was always broken for V2 clients.  So
disassemble and reconstitute the message instead.

Issues reported by Peter Eisentraut.  Patch by me, reviewed by
Peter Eisentraut.
2016-06-30 18:35:32 -04:00
..
aggregatecmds.c Fix type-safety problem with parallel aggregate serial/deserialization. 2016-06-22 16:52:41 -04:00
alter.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
amcmds.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
analyze.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
async.c Fix several mistakes around parallel workers and client_encoding. 2016-06-30 18:35:32 -04:00
cluster.c Fix various common mispellings. 2016-06-03 16:08:45 +01:00
collationcmds.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
comment.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
constraint.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
conversioncmds.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
copy.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
createas.c Fix CREATE MATVIEW/CREATE TABLE AS ... WITH NO DATA to not plan the query. 2016-06-27 15:57:50 -04:00
dbcommands.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
define.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
discard.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
dropcmds.c Fix DROP ACCESS METHOD IF EXISTS. 2016-05-27 11:03:18 -04:00
event_trigger.c Type names should not be quoted 2016-04-01 13:35:48 -03:00
explain.c Fix some infelicities in EXPLAIN output for parallel query plans. 2016-06-29 18:51:20 -04:00
extension.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
foreigncmds.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
functioncmds.c Fix parallel-safety code for parallel aggregation. 2016-04-05 16:06:15 -04:00
indexcmds.c Disallow creation of indexes on system columns (except for OID). 2016-04-16 12:11:41 -04:00
lockcmds.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Support CREATE ACCESS METHOD 2016-03-23 23:01:35 -03:00
matview.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
opclasscmds.c Fix broken dependency-mongering for index operator classes/families. 2016-04-13 23:33:31 -04:00
operatorcmds.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
policy.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
portalcmds.c Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
prepare.c On second thought, disable parallelism for prepared statements. 2016-02-26 16:33:37 +05:30
proclang.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
schemacmds.c Remove various special checks around default roles 2016-05-06 14:06:50 -04:00
seclabel.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
sequence.c Revert no-op changes to BufferGetPage() 2016-04-20 08:31:19 -05:00
tablecmds.c Remove various special checks around default roles 2016-05-06 14:06:50 -04:00
tablespace.c Remove various special checks around default roles 2016-05-06 14:06:50 -04:00
trigger.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
tsearchcmds.c Update copyright for 2016 2016-01-02 13:33:40 -05:00
typecmds.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
user.c pgindent run for 9.6 2016-06-09 18:02:36 -04:00
vacuum.c Add VACUUM (DISABLE_PAGE_SKIPPING) for emergencies. 2016-06-17 15:48:57 -04:00
vacuumlazy.c Add VACUUM (DISABLE_PAGE_SKIPPING) for emergencies. 2016-06-17 15:48:57 -04:00
variable.c Fix several mistakes around parallel workers and client_encoding. 2016-06-30 18:35:32 -04:00
view.c Fix CREATE MATVIEW/CREATE TABLE AS ... WITH NO DATA to not plan the query. 2016-06-27 15:57:50 -04:00