Output filter for psql

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Output filter for psql
Date: 2009-01-08 22:22:04
Message-ID: 20090108172204.c114e71e.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have mentioned this as a side issue in another thread. I thought
that it would be useful to start a separate thread for this. Perhaps
this won't be so difficult to code and we can forget all about the ReST
discussion.

So, I guess psql should pass XML to the user's filter and simply dump
its output to the screen. Is XML the best format? It would allow us
to pass meta information. For example, we could pass the border
setting so that the filter could change its output based on it.

As for syntax, I'm not sure how difficult it would be to code but I was
thinking something like this:

\filter <format> <path>

This would create a new format that can be set with pset. For example:

\filter rest ~/my_filter
...
\pset format rest

I would imagine that the filter command would normally go into
~/.psqlrc since it would only be activated by the pset call.

--
D'Arcy J.M. Cain <darcy(at)druid(dot)net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-08 22:59:31 Re: Improving compressibility of WAL files
Previous Message Andrew Dunstan 2009-01-08 22:02:27 Constraint docs