Re: Output filter for psql

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: Output filter for psql
Дата
Msg-id 20090128135106.ff8f7b0e.darcy@druid.net
обсуждение исходный текст
Ответ на Output filter for psql  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Ответы Re: Output filter for psql  (Andrew Dunstan <andrew@dunslane.net>)
Список 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 по дате отправления:

Предыдущее
От: Joshua Brindle
Дата:
Сообщение: Re: How to get SE-PostgreSQL acceptable
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Hot Standby (v9d)