Re: How to create crude report with psql and/or plpgsql

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>, pgsql-sql(at)postgresql(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to create crude report with psql and/or plpgsql
Date: 2002-03-20 15:57:54
Message-ID: 20020320155754.23745.qmail@web20804.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

I have found psql by itself to be quite sufficient to
produce some nice looking reports.

Basic approach is to create script like:
SELECT 'This is my header';
SELECT <whatever data desired>;
SELECT <subtotals or whatever else desired>;
SELECT 'Report run at: ' || current_timestamp;
(as an example footer)

You can also introduce psql commands along the way to
vary the appearance of the output.

I have found it possible to go a long way with a
simple approach like this. If you want a high degree
of control over the appearance, you will need to
follow one of the other suggestions made during the
course of this thread.

--- Jean-Luc Lachance <jllachan(at)nsd(dot)ca> wrote:
> Hi all,
>
> I did not find any kind of print statement in psql
> or plpgsql.
> So, how can I create basic report with psql and/or
> plpgsql?
> Nothing fancy, page header/footer sub-totals per
> page.
>
> JLL
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2002-03-20 15:59:04 Re: Generating a list of days
Previous Message Jean-Michel POURE 2002-03-20 15:55:02 Re: Auomatic numbering, replacing nulls and IF

Browse pgsql-sql by date

  From Date Subject
Next Message Marin Dimitrov 2002-03-20 16:12:10 Re: How do I set the system time on production server?
Previous Message german pulido 2002-03-20 15:26:30 plpgsql how to iterate through record values?