Skip to content

Commit ef4894f

Browse files
authored
setting standard_conforming_strings on the client side (#4304)
Setting this on the client-side to avoid needing to validate this on the server. Fixes: DBI-739
1 parent e441f6a commit ef4894f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

flow/connectors/postgres/postgres.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func NewPostgresConnector(ctx context.Context, env map[string]string, pgConfig *
7070
connConfig.Config.RuntimeParams["idle_in_transaction_session_timeout"] = "0"
7171
connConfig.Config.RuntimeParams["statement_timeout"] = "0"
7272
connConfig.Config.RuntimeParams["DateStyle"] = "ISO, DMY"
73+
// Required for QueryExecModeSimpleProtocol, which is set in some places while querying;
74+
// pgx refuses simple protocol when the server reports standard_conforming_strings=off.
75+
connConfig.Config.RuntimeParams["standard_conforming_strings"] = "on"
7376

7477
tunnel, err := utils.NewSSHTunnel(ctx, pgConfig.SshConfig)
7578
if err != nil {

flow/connectors/postgres/postgres_source.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ func (c *PostgresConnector) CreateReplConn(ctx context.Context, env map[string]s
4949
replConfig.Config.RuntimeParams["bytea_output"] = "hex"
5050
replConfig.Config.RuntimeParams["intervalstyle"] = "postgres"
5151
replConfig.Config.RuntimeParams["DateStyle"] = "ISO, DMY"
52+
// Required for QueryExecModeSimpleProtocol below; pgx refuses simple
53+
// protocol when the server reports standard_conforming_strings=off.
54+
replConfig.Config.RuntimeParams["standard_conforming_strings"] = "on"
5255
replConfig.DefaultQueryExecMode = pgx.QueryExecModeSimpleProtocol
5356

5457
walSenderTimeout, err := internal.PeerDBPostgresWalSenderTimeout(ctx, env)

0 commit comments

Comments
 (0)