Re: [Bug fix]If recovery.conf has target_session_attrs=read-write, the standby fails to start.

Higuchi, Daisuke <higuchi.daisuke@jp.fujitsu.com>

From: "Higuchi, Daisuke" <higuchi.daisuke@jp.fujitsu.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-05-19T07:05:30Z
Lists: pgsql-hackers

Attachments

From: Michael Paquier [mailto:michael.paquier@gmail.com]
>                     if (!PQsendQuery(conn,
>-                                     "show transaction_read_only"))
>+                                     "SHOW transaction_read_only"))
>Or perhaps the replication command parser could be made more flexible with lower-case characters for replication commands?
By adding flex option '-i', replication command parser could be more flexible. 

# repl_scanner is compiled as part of repl_gram
 repl_gram.o: repl_scanner.c
+repl_scanner.c: FLEXFLAGS = -CF -p -i

This option is already used for syncrep_scanner.c, so it is not strange to add for repl_scanner.c too. 
Attached patch also fixes this problem. 

Regards, 
Daisuke, Higuchi 

Commits

  1. Rethink flex flags for syncrep_scanner.l.

  2. Capitalize SHOW when testing whether target_session_attrs=read-write.