Re: 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: Re: Output filter for psql
Date: 2009-01-28 18:51:06
Message-ID: 20090128135106.ff8f7b0e.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 8 Jan 2009 17:22:04 -0500
"D'Arcy J.M. Cain" <darcy(at)druid(dot)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(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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2009-01-28 18:55:06 Re: Hot Standby (v9d)
Previous Message Joshua Brindle 2009-01-28 18:49:21 Re: How to get SE-PostgreSQL acceptable