From jllachan@nsd.ca Tue Mar 19 18:04:30 2002 Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id 89AEC475964; Tue, 19 Mar 2002 13:04:30 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id NAA03337; Tue, 19 Mar 2002 13:04:29 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma003335; Tue, 19 Mar 02 13:04:15 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id NAA04106; Tue, 19 Mar 2002 13:08:11 -0500 Message-ID: <3C977E7E.D2EC1CF0@nsd.ca> Date: Tue, 19 Mar 2002 13:07:58 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: pgsql-general@postgresql.org Subject: How to create crude report with psql and/or plpgsql References: <2266D0630E43BB4290742247C89105758DCAB6@dozer.computec.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/946 X-Sequence-Number: 22315 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 From drew@xyzzy.dhs.org Tue Mar 19 18:21:29 2002 Received: from xyzzy.lan.internal (turbo-173.kingston.net [216.123.190.173]) by postgresql.org (Postfix) with ESMTP id 17223475D4A; Tue, 19 Mar 2002 13:21:29 -0500 (EST) Received: from drew by xyzzy.lan.internal with local (Exim 3.35 #1 (Debian)) id 16nOEX-0006EN-00; Tue, 19 Mar 2002 13:21:17 -0500 Date: Tue, 19 Mar 2002 13:21:16 -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: <20020319182116.GB23827@xyzzy.dhs.org> References: <2266D0630E43BB4290742247C89105758DCAB6@dozer.computec.de> <3C977E7E.D2EC1CF0@nsd.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <3C977E7E.D2EC1CF0@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/947 X-Sequence-Number: 22316 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2002 at 01:07:58PM -0500, Jean-Luc Lachance wrote: > 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. Errr... psql is a database query tool. There's not much available=20 for doing that kind of thing. That said, why not just write a=20 script to do it: #!/bin/sh echo <This is a title END # do the query psql --html --command 'SELECT * FROM foo' my_dbase echo < END Of course if you really insist on doing it in psql, you could just write SELECT statements that select a preset string. Ugly, but=20 it would work: SELECT '... '::text; --=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 --BXVAT5kNtrzKuDFl 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 iEYEARECAAYFAjyXgZwACgkQCT73CrRXhLF4GACeKN7CJQJoE513yQkMZEcD/Hkk 9HoAoI4lbyiqtTTZy1awnEUy7BLIzQTa =y6ZG -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl-- From jllachan@nsd.ca Tue Mar 19 18:29:33 2002 Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id 435AF475964; Tue, 19 Mar 2002 13:29:33 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id NAA03533; Tue, 19 Mar 2002 13:29:30 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to <jllachan@nsd.ca> using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma003529; Tue, 19 Mar 02 13:29:30 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id NAA04733; Tue, 19 Mar 2002 13:33:26 -0500 Message-ID: <3C978469.38387B8C@nsd.ca> Date: Tue, 19 Mar 2002 13:33:13 -0500 From: Jean-Luc Lachance <jllachan@nsd.ca> X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: "Andrew G. Hammond" <drew@xyzzy.dhs.org> Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] How to create crude report with psql and/or plpgsql References: <2266D0630E43BB4290742247C89105758DCAB6@dozer.computec.de> <3C977E7E.D2EC1CF0@nsd.ca> <20020319182116.GB23827@xyzzy.dhs.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/948 X-Sequence-Number: 22317 Hello Andrew, I do not need HTML, just plain text or maybe PDF. It would be nice if there was one extra level for RAISE as in: RAISE PRINT 'Whatever' That would not send the message the log but only to the console. One could do alot with that. JLL "Andrew G. Hammond" wrote: > > On Tue, Mar 19, 2002 at 01:07:58PM -0500, Jean-Luc Lachance wrote: > > > 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. > > 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: > > #!/bin/sh > echo <<END > <html><head><title>This is a title > > > END > > # do the query > psql --html --command 'SELECT * FROM foo' my_dbase > > echo < > > END > From drew@xyzzy.dhs.org Tue Mar 19 18:41:11 2002 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-- From pgman@candle.pha.pa.us Tue Mar 19 18:57:10 2002 Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 39B97475C57; Tue, 19 Mar 2002 13:57:10 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g2JIuod19764; Tue, 19 Mar 2002 13:56:50 -0500 (EST) From: Bruce Momjian Message-Id: <200203191856.g2JIuod19764@candle.pha.pa.us> Subject: Re: [SQL] How to create crude report with psql and/or plpgsql In-Reply-To: <3C978469.38387B8C@nsd.ca> To: Jean-Luc Lachance Date: Tue, 19 Mar 2002 13:56:50 -0500 (EST) Cc: "Andrew G. Hammond" , pgsql-sql@postgresql.org, pgsql-general@postgresql.org X-Mailer: ELM [version 2.4ME+ PL97 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200203/955 X-Sequence-Number: 22324 Jean-Luc Lachance wrote: > Hello Andrew, > > I do not need HTML, just plain text or maybe PDF. > > It would be nice if there was one extra level for RAISE as in: > RAISE PRINT 'Whatever' > That would not send the message the log but only to the console. > One could do alot with that. 7.3 will have that. It will be RAISE INFO, which goes only to the client. RAISE LOG goes only to the server logs. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 From pgman@candle.pha.pa.us Tue Mar 19 19:18:19 2002 Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id A972A475F6A; Tue, 19 Mar 2002 14:18:19 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g2JJIEO28898; Tue, 19 Mar 2002 14:18:14 -0500 (EST) From: Bruce Momjian Message-Id: <200203191918.g2JJIEO28898@candle.pha.pa.us> Subject: Re: [SQL] How to create crude report with psql and/or plpgsql In-Reply-To: <3C978F1B.E50787D9@nsd.ca> To: Jean-Luc Lachance Date: Tue, 19 Mar 2002 14:18:14 -0500 (EST) Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org X-Mailer: ELM [version 2.4ME+ PL97 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200203/957 X-Sequence-Number: 22326 Jean-Luc Lachance wrote: > Hello Bruce, > > How about simply PRINT; maybe something like a printf. > > Just as long as there will be no prefix like 'INFO:' or 'NOTICE:' Indeed, there will be a prefix if INFO: or NOTICE:. No one has asked for those to be removed before. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 From jllachan@nsd.ca Tue Mar 19 19:15:34 2002 Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id CEB87475F28; Tue, 19 Mar 2002 14:15:34 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id OAA04084; Tue, 19 Mar 2002 14:15:31 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma004082; Tue, 19 Mar 02 14:15:08 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id OAA05677; Tue, 19 Mar 2002 14:19:04 -0500 Message-ID: <3C978F1B.E50787D9@nsd.ca> Date: Tue, 19 Mar 2002 14:18:51 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Momjian Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] How to create crude report with psql and/or plpgsql References: <200203191856.g2JIuod19764@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/956 X-Sequence-Number: 22325 Hello Bruce, How about simply PRINT; maybe something like a printf. Just as long as there will be no prefix like 'INFO:' or 'NOTICE:' JLL Bruce Momjian wrote: > > Jean-Luc Lachance wrote: > > Hello Andrew, > > > > I do not need HTML, just plain text or maybe PDF. > > > > It would be nice if there was one extra level for RAISE as in: > > RAISE PRINT 'Whatever' > > That would not send the message the log but only to the console. > > One could do alot with that. > > 7.3 will have that. It will be RAISE INFO, which goes only to the > client. RAISE LOG goes only to the server logs. > From jllachan@nsd.ca Tue Mar 19 19:39:34 2002 Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id 45544475E0B; Tue, 19 Mar 2002 14:39:34 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id OAA04332; Tue, 19 Mar 2002 14:39:31 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma004330; Tue, 19 Mar 02 14:39:08 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id OAA06237; Tue, 19 Mar 2002 14:43:05 -0500 Message-ID: <3C9794BC.EB5A6597@nsd.ca> Date: Tue, 19 Mar 2002 14:42:52 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Momjian Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] How to create crude report with psql and/or plpgsql References: <200203191918.g2JJIEO28898@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/958 X-Sequence-Number: 22327 Well, count my vote. Any body else who see the usefullness of a PRINT statement? Bruce Momjian wrote: > > Jean-Luc Lachance wrote: > > Hello Bruce, > > > > How about simply PRINT; maybe something like a printf. > > > > Just as long as there will be no prefix like 'INFO:' or 'NOTICE:' > > Indeed, there will be a prefix if INFO: or NOTICE:. No one has asked > for those to be removed before. > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 From jllachan@nsd.ca Tue Mar 19 20:43:09 2002 Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id D68EC475450; Tue, 19 Mar 2002 15:43:09 -0500 (EST) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id PAA05082; Tue, 19 Mar 2002 15:42:03 -0500 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma005078; Tue, 19 Mar 02 15:41:46 -0500 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id PAA07044; Tue, 19 Mar 2002 15:45:43 -0500 Message-ID: <3C97A36A.BFB6B960@nsd.ca> Date: Tue, 19 Mar 2002 15:45:30 -0500 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: wsheldah@lexmark.com Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: [SQL] How to create crude report with psql and/or plpgsql References: <200203192024.PAA04499@interlock2.lexmark.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/963 X-Sequence-Number: 22332 Wes, I Agree, but I am thinking of psql here. PSQL is a front-end to PostgreSQL. Is it not? We could still use the RAISE NOTICE or RAISE INFO on the back-end, but PSQL should strip the INFO and/or NOTICE prefix. Mind you, from the back-end perspective, a RAISE INFO or NOTICE is just like a printf. JLL wsheldah@lexmark.com wrote: > > PRINT just seems like the wrong sort of thing for a database to do. If you want > printed output, use some client language like perl, java, c, whatever, to get > stuff out of the database and print it. > > Or use one of those languages to write an easy filter that removes the INFO and > NOTICE prefixes before actually printing them. Use the right tool for the job. > > Wes Sheldahl > > Jean-Luc Lachance on 03/19/2002 02:42:52 > PM > > To: Bruce Momjian > cc: pgsql-sql%postgresql.org@interlock.lexmark.com, > pgsql-general%postgresql.org@interlock.lexmark.com (bcc: Wesley > Sheldahl/Lex/Lexmark) > Subject: Re: [GENERAL] [SQL] How to create crude report with psql and/or > plpgsql > > Well, count my vote. > Any body else who see the usefullness of a PRINT statement? > > Bruce Momjian wrote: > > > > Jean-Luc Lachance wrote: > > > Hello Bruce, > > > > > > How about simply PRINT; maybe something like a printf. > > > > > > Just as long as there will be no prefix like 'INFO:' or 'NOTICE:' > > > > Indeed, there will be a prefix if INFO: or NOTICE:. No one has asked > > for those to be removed before. > > > > -- > > Bruce Momjian | http://candle.pha.pa.us > > pgman@candle.pha.pa.us | (610) 853-3000 > > + If your life is a hard drive, | 830 Blythe Avenue > > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html From rmello@cc.usu.edu Tue Mar 19 21:35:05 2002 Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id DDBF6475CCE; Tue, 19 Mar 2002 16:35:05 -0500 (EST) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 16nRGL-0005jD-00; Tue, 19 Mar 2002 14:35:21 -0700 Date: Tue, 19 Mar 2002 14:35:21 -0700 From: Roberto Mello To: Jean-Luc Lachance Cc: "Andrew G. Hammond" , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: How to create crude report with psql and/or plpgsql Message-ID: <20020319213521.GA22001@cc.usu.edu> References: <2266D0630E43BB4290742247C89105758DCAB6@dozer.computec.de> <3C977E7E.D2EC1CF0@nsd.ca> <20020319182116.GB23827@xyzzy.dhs.org> <3C978469.38387B8C@nsd.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <3C978469.38387B8C@nsd.ca> User-Agent: Mutt/1.3.27i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Archive-Number: 200203/246 X-Sequence-Number: 7125 On Tue, Mar 19, 2002 at 01:33:13PM -0500, Jean-Luc Lachance wrote: > Hello Andrew, > > I do not need HTML, just plain text or maybe PDF. > > It would be nice if there was one extra level for RAISE as in: > RAISE PRINT 'Whatever' > That would not send the message the log but only to the console. > One could do alot with that. s/alot/a lot/ You could use one of the other PL languages to do that. I'm sure the PL/*U languages do that, but perhaps the other regular PL languages would do as well (Tcl, Python, Perl). -Roberto -- +----| http://fslc.usu.edu/ USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net/ http://www.sdl.usu.edu/ - Space Dynamics Lab, Developer From reedstrm@rice.edu Tue Mar 19 22:12:16 2002 Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (Postfix) with ESMTP id A4B14475D22; Tue, 19 Mar 2002 17:12:16 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 76ABF68A83; Tue, 19 Mar 2002 16:12:16 -0600 (CST) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 392D568A80; Tue, 19 Mar 2002 16:12:15 -0600 (CST) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.34 #1 (Debian)) id 16nRq3-0000NY-00; Tue, 19 Mar 2002 16:12:15 -0600 Date: Tue, 19 Mar 2002 16:12:14 -0600 From: "Ross J. Reedstrom" To: Jean-Luc Lachance Cc: Bruce Momjian , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: How to create crude report with psql and/or plpgsql Message-ID: <20020319221214.GA1363@rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Jean-Luc Lachance , Bruce Momjian , pgsql-sql@postgresql.org, pgsql-general@postgresql.org References: <200203191918.g2JJIEO28898@candle.pha.pa.us> <3C9794BC.EB5A6597@nsd.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C9794BC.EB5A6597@nsd.ca> User-Agent: Mutt/1.3.27i X-Virus-Scanned: by AMaViS snapshot-20010714 X-Archive-Number: 200203/247 X-Sequence-Number: 7126 On Tue, Mar 19, 2002 at 02:42:52PM -0500, Jean-Luc Lachance wrote: > Well, count my vote. > Any body else who see the usefullness of a PRINT statement? what's wrong with: $ psql -t -c "select 'Hello World!'" template1 Hello World! $ > Bruce Momjian wrote: > > > > Jean-Luc Lachance wrote: > > > Hello Bruce, > > > > > > How about simply PRINT; maybe something like a printf. > > > > > > Just as long as there will be no prefix like 'INFO:' or 'NOTICE:' > > > > Indeed, there will be a prefix if INFO: or NOTICE:. No one has asked > > for those to be removed before. From peter_e@gmx.net Tue Mar 19 22:41:42 2002 Received: from student.gvsu.edu (unknown [148.61.7.124]) by postgresql.org (Postfix) with ESMTP id 05A68475B70; Tue, 19 Mar 2002 17:41:42 -0500 (EST) Received: from [148.61.250.135] [148.61.250.135] by student.gvsu.edu with Novonyx SMTP Server $Revision: 2.74 $; Tue, 19 Mar 2002 17:41:44 -0500 (EDT) Date: Tue, 19 Mar 2002 17:45:41 -0500 (EST) From: Peter Eisentraut X-Sender: To: Jean-Luc Lachance Cc: "Andrew G. Hammond" , , Subject: Re: [SQL] How to create crude report with psql and/or plpgsql In-Reply-To: <3C978469.38387B8C@nsd.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/971 X-Sequence-Number: 22340 Jean-Luc Lachance writes: > I do not need HTML, just plain text or maybe PDF. psql can generate LaTeX tables, which you can convert to PDF. -- Peter Eisentraut peter_e@gmx.net From jeff_eckermann@yahoo.com Wed Mar 20 15:57:49 2002 Received: from web20804.mail.yahoo.com (web20804.mail.yahoo.com [216.136.226.193]) by postgresql.org (Postfix) with SMTP id 8FD6B475DFC for ; Wed, 20 Mar 2002 10:57:49 -0500 (EST) Message-ID: <20020320155754.23745.qmail@web20804.mail.yahoo.com> Received: from [68.14.98.218] by web20804.mail.yahoo.com via HTTP; Wed, 20 Mar 2002 07:57:54 PST Date: Wed, 20 Mar 2002 07:57:54 -0800 (PST) From: Jeff Eckermann Subject: Re: How to create crude report with psql and/or plpgsql To: Jean-Luc Lachance , pgsql-sql@postgresql.org Cc: pgsql-general@postgresql.org In-Reply-To: <3C977E7E.D2EC1CF0@nsd.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200203/1020 X-Sequence-Number: 22387 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 ; SELECT ; 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 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/