File tree 1 file changed +36
-1
lines changed
1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ sub psql_fails_like
60
60
}
61
61
62
62
my $node = PostgreSQL::Test::Cluster-> new(' main' );
63
- $node -> init;
63
+ $node -> init( extra => [ ' --locale=C ' , ' --encoding=UTF8 ' ]) ;
64
64
$node -> append_conf(
65
65
' postgresql.conf' , q{
66
66
wal_level = 'logical'
@@ -80,4 +80,39 @@ sub psql_fails_like
80
80
qr / unexpected PQresultStatus: 8$ / ,
81
81
' handling of unexpected PQresultStatus' );
82
82
83
+ # test \timing
84
+ psql_like(
85
+ $node ,
86
+ ' \timing on
87
+ SELECT 1' ,
88
+ qr / ^1$
89
+ ^Time: \d +.\d\d\d ms/ m ,
90
+ ' \timing' );
91
+
92
+ # test that ENCODING variable is set and that it is updated when
93
+ # client encoding is changed
94
+ psql_like(
95
+ $node ,
96
+ ' \echo :ENCODING
97
+ set client_encoding = LATIN1;
98
+ \echo :ENCODING' ,
99
+ qr / ^UTF8$
100
+ ^LATIN1$ / m ,
101
+ ' ENCODING variable is set and updated' );
102
+
103
+ # test LISTEN/NOTIFY
104
+ psql_like(
105
+ $node ,
106
+ ' LISTEN foo;
107
+ NOTIFY foo;' ,
108
+ qr / ^Asynchronous notification "foo" received from server process with PID \d +\. $ / ,
109
+ ' notification' );
110
+
111
+ psql_like(
112
+ $node ,
113
+ " LISTEN foo;
114
+ NOTIFY foo, 'bar';" ,
115
+ qr / ^Asynchronous notification "foo" with payload "bar" received from server process with PID \d +\. $ / ,
116
+ ' notification with payload' );
117
+
83
118
done_testing();
You can’t perform that action at this time.
0 commit comments