Re: Proposal to add --single-row to psql - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Proposal to add --single-row to psql
Date
Msg-id CAM3SWZRP2r7yMF__kiPuC-rmTfVTAq1jiVWQu_weyKwt44uy1A@mail.gmail.com
Whole thread Raw
In response to Re: Proposal to add --single-row to psql  (Jim Nasby <jim@nasby.net>)
List pgsql-hackers
On Sun, May 12, 2013 at 1:18 PM, Jim Nasby <jim@nasby.net> wrote:
> FWIW, I've wanted the ability to plug into the parser not for an extension,
> but so that I could programmaticly enforce certain coding conventions.

Depending on the exact requirements, that probably wouldn't be too
difficult. It'd likely entail adding a hook for plugins to inspect raw
parse trees.

The pg_stat_statements core infrastructure changes for 9.2 added a
hook that allowed pg_stat_statements to inspect the post-parse
analysis (query) tree. That wouldn't be suitable for what you want,
though, because that tree loses many of the details that you are
likely to care about but are inconsequential to the semantics of the
query. For example, you couldn't tell from the post-parse analysis
tree if the query text was originally "select all, the, columns from
table" or "select * from table".


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Add more regression tests for dbcommands
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Logging of PAM Authentication Failure