pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Jean-Luc Lachance <jllachan@nsd.ca>
To: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: How to create crude report with psql and/or plpgsql
Date: Wed, 20 Mar 2002 07:57:54 -0800 (PST)
Message-ID: <20020320155754.23745.qmail@web20804.mail.yahoo.com> (raw)
In-Reply-To: <3C977E7E.D2EC1CF0@nsd.ca>

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@nsd.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/



view thread (13+ messages)

Message-ID: <20020320155754.23745.qmail@web20804.mail.yahoo.com>
Permalink:  ../20020320155754.23745.qmail@web20804.mail.yahoo.com/
Also on:    postgresql.org/message-id/20020320155754.23745.qmail@web20804.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jeff_eckermann@yahoo.com, jllachan@nsd.ca, pgsql-general@postgresql.org
  Subject: Re: How to create crude report with psql and/or plpgsql
  In-Reply-To: <20020320155754.23745.qmail@web20804.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox