Re: Output filter for psql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Output filter for psql
Date: 2009-01-28 19:08:54
Message-ID: 4980AD46.30803@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

D'Arcy J.M. Cain wrote:
> 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 \":\""
>

Why do you want to add this extra information? psql doesn't output it
now, and IIRC your original proposal didn't do it either.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-01-28 19:27:27 Re: Hot Standby (v9d)
Previous Message Tom Lane 2009-01-28 19:06:30 Re: pg_upgrade project status