diff --git a/ext/pg_query/pg_query_deparse.c b/ext/pg_query/pg_query_deparse.c index a62ae33..f37e5a0 100644 --- a/ext/pg_query/pg_query_deparse.c +++ b/ext/pg_query/pg_query_deparse.c @@ -9440,7 +9440,7 @@ static void deparseVariableShowStmt(StringInfo str, VariableShowStmt *variable_s else if (strcmp(variable_show_stmt->name, "session_authorization") == 0) appendStringInfoString(str, "SESSION AUTHORIZATION"); else if (strcmp(variable_show_stmt->name, "all") == 0) - appendStringInfoString(str, "SESSION ALL"); + appendStringInfoString(str, "ALL"); else appendStringInfoString(str, quote_identifier(variable_show_stmt->name)); } diff --git a/spec/lib/pg_query/deparse_spec.rb b/spec/lib/pg_query/deparse_spec.rb index 9c205ac..c3c27bb 100644 --- a/spec/lib/pg_query/deparse_spec.rb +++ b/spec/lib/pg_query/deparse_spec.rb @@ -2181,5 +2181,19 @@ it { is_expected.to eq query } end end + + context 'SHOW' do + context 'show work_mem' do + let(:query) { 'SHOW work_mem' } + + it { is_expected.to eq query } + end + + context 'show all' do + let(:query) { 'SHOW ALL' } + + it { is_expected.to eq query } + end + end end end