Re: Output filter for psql - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Output filter for psql
Date
Msg-id 20090128135106.ff8f7b0e.darcy@druid.net
Whole thread Raw
In response to Output filter for psql  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: Output filter for psql  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On Thu, 8 Jan 2009 17:22:04 -0500
"D'Arcy J.M. Cain" <darcy@druid.net> wrote:
> 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.

Pardon me while I argue with myself.  :-)

I wonder if XML isn't overkill for this.  I think that we only need
three pieces of information:- The column headings- The column types (in case the user wants it)- The data

XML would be difficult from both the server as well as the user.
Perhaps the simplest thing for both sides is simply CSV with an extra
row for type.  For example:

person_id,person_name,person_email
int,text,text
1,"darcy","D'Arcy Cain"
2,"tom","Tom Lane"
3,"bruce","Bruce Momjian"
...etc.

The user could choose to ignore the second line if he doesn't need it.
I suppose we could define another line with options that we could
define for meta information such as the border setting and the table
name and whatever we define later.  E.g:

"table:person","border:3","funky:option with \":\""

-- 
D'Arcy J.M. Cain <darcy@druid.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.


pgsql-hackers by date:

Previous
From: Joshua Brindle
Date:
Subject: Re: How to get SE-PostgreSQL acceptable
Next
From: Gregory Stark
Date:
Subject: Re: Hot Standby (v9d)