Received: from xyzzy.lan.internal (turbo-173.kingston.net [216.123.190.173]) by postgresql.org (Postfix) with ESMTP id 9795B476414; Tue, 19 Mar 2002 13:41:11 -0500 (EST) Received: from drew by xyzzy.lan.internal with local (Exim 3.35 #1 (Debian)) id 16nOXl-0006FH-00; Tue, 19 Mar 2002 13:41:09 -0500 Date: Tue, 19 Mar 2002 13:41:09 -0500 To: Jean-Luc Lachance Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] How to create crude report with psql and/or plpgsql Message-ID: <20020319184109.GC23827@xyzzy.dhs.org> References: <2266D0630E43BB4290742247C89105758DCAB6@dozer.computec.de> <3C977E7E.D2EC1CF0@nsd.ca> <20020319182116.GB23827@xyzzy.dhs.org> <3C978469.38387B8C@nsd.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WYTEVAkct0FjGQmd" Content-Disposition: inline In-Reply-To: <3C978469.38387B8C@nsd.ca> User-Agent: Mutt/1.3.27i From: "Andrew G. Hammond" X-Fnord: +++ath X-WebTV-Stationery: Standard; BGColor=black; TextColor=black X-Message-Flag: Message text blocked: ANTI-MICROSOFT OPINIONS X-BeenThere: drew@xyzzy.dhs.org X-Archive-Number: 200203/952 X-Sequence-Number: 22321 --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2002 at 01:33:13PM -0500, Jean-Luc Lachance wrote: > I do not need HTML, just plain text So just do it in plain text then: #!/bin/sh echo < or maybe PDF. Please don't use bad words. PDF is a proprietary format. Beware. =20=20=20 > It would be nice if there was one extra level for RAISE as in: > RAISE PRINT 'Whatever'=20 > That would not send the message the log but only to the console. > One could do alot with that. Something wrong with using SELECT 'whatever'; or didn't you even read as far as the end of my first message? > "Andrew G. Hammond" wrote: > >=20 > > On Tue, Mar 19, 2002 at 01:07:58PM -0500, Jean-Luc Lachance wrote: > >=20 > > > 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. > >=20 > > Errr... psql is a database query tool. There's not much available > > for doing that kind of thing. That said, why not just write a > > script to do it: > >=20 > > #!/bin/sh > > echo < > This is a title > > > > > > END > >=20 > > # do the query > > psql --html --command 'SELECT * FROM foo' my_dbase > >=20 > > echo < > > > > > END > > --=20 Andrew G. Hammond mailto:drew@xyzzy.dhs.org http://xyzzy.dhs.org/~drew/ 56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F 613-389-5481= =20 5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1 "To blow recursion you must first blow recur" -- me --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjyXhkUACgkQCT73CrRXhLFh/QCff14H6dWLZ1eoB+MVGqLpf6HN /LYAn08H3MB1SvVPhCUotgds3YHWoApY =fUWL -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd--