Craig Ringer <> writes:
> That's what I'm currently doing, I just wanted something that makes it
> quicker and easier. Jumping around the tree is good, but easy
> collapse/expand would be much better.

As I'm using psql under an Emacs M-x shell buffer, I wanted to
experiment with your problem here, so that fellow PostgreSQL hackers
using Emacs too can benefit already. I'm sure most already have some
setup for that, but maybe not.

Using the external package hide-region as documented at the following
place solved it:

Now I can easily collapse and expand regions directly from within the
M-x shell psql buffer, no copy paste, no effort needed. When the point
is on an opening block { it will do the right thing, if I want to hide
something more detailed I can select a region then hide it.

Of course using the default following tool makes things really easier as
a single key stroke will default to selecting the right region, and
another one will expand the selection to the next logical block.

  C-M-SPC runs the command mark-sexp

Oh, and you can define the region using your mouse too.

As often, when searching for text based interactive manipulation
tooling, the best I could find is the one I'm already using, EmacsĀ ;-)

Dimitri Fontaine     PostgreSQL : Expertise, Formation et Support

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to