Add a semicolon to query related to search_path

From: Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Add a semicolon to query related to search_path
Date: 2018-08-15 04:51:53
Message-ID: b9ea9035-ad1a-eef2-fda4-7a6513e69599@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I found some improvements in Client Applications in /src/bin/scripts when I
resumed development of progress monitor for cluster command.

Attached patch gives the following query a semicolon for readability.

s/SELECT pg_catalog.set_config ('search_path', '', false)/
SELECT pg_catalog.set_config ('search_path', '', false);/

s/RESET search_path/RESET search_path;/

For example,
Client application vacuumdb's results using the patch are following:

# Not patched #

$ vacuumdb -e -Zt 'pg_am(amname)'

SELECT pg_catalog.set_config ('search_path', '', false)
vacuumdb: vacuuming database "postgres"
RESET search_path
SELECT c.relname, ns.nspname
  FROM pg_catalog.pg_class c, pg_catalog.pg_namespace ns
  WHERE c.relnamespace OPERATOR (pg_catalog. =) Ns.oid
  AND c.oid OPERATOR (pg_catalog. =) 'Pg_am' :: pg_catalog.regclass;
SELECT pg_catalog.set_config ('search_path', '', false)
ANALYZE pg_catalog.pg_am (amname);

# Patched #

$ vacuumdb -e -Zt 'pg_am(amname)'

SELECT pg_catalog.set_config ('search_path', '', false);
vacuumdb: vacuuming database "postgres"
RESET search_path;
SELECT c.relname, ns.nspname
  FROM pg_catalog.pg_class c, pg_catalog.pg_namespace ns
  WHERE c.relnamespace OPERATOR (pg_catalog. =) Ns.oid
  AND c.oid OPERATOR (pg_catalog. =) 'Pg_am' :: pg_catalog.regclass;
SELECT pg_catalog.set_config ('search_path', '', false);
ANALYZE pg_catalog.pg_am (amname);

I tested "make check-world" and "make installcheck-world" on 777e6ddf1
and are fine.

Regards,
Tatsuro Yamada
NTT Open Source Software Center

Attachment Content-Type Size
add_semicolon_to_queries.patch text/x-patch 995 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-08-15 05:56:19 Re: Proposal: SLRU to Buffer Cache
Previous Message Amit Langote 2018-08-15 04:04:55 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.