pretty print viewdefs

From: Andrew Dunstan <andrew(dot)dunstan(at)pgexperts(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pretty print viewdefs
Date: 2009-08-26 12:54:08
Message-ID: 4A953070.6030704@pgexperts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


The tiny patch attached fixes a long-standing peeve of mine (and at
least one of my clients'), namely that the target list printed in
viewdefs are unreadable.

example output now looks like this:

regression=# select pg_get_viewdef('shoe',true);
pg_get_viewdef
-----------------------------------------------
SELECT
sh.shoename,
sh.sh_avail,
sh.slcolor,
sh.slminlen,
sh.slminlen * un.un_fact AS slminlen_cm,
sh.slmaxlen,
sh.slmaxlen * un.un_fact AS slmaxlen_cm,
sh.slunit
FROM shoe_data sh, unit un
WHERE sh.slunit = un.un_name;

Is there any objection?

cheers

andrew

Attachment Content-Type Size
prettyprint.patch text/x-patch 598 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel Pouré 2009-08-26 13:52:38 PostgreSQL does CAST implicitely between int and a domain derived from int during SELECT query
Previous Message Rick Gigger 2009-08-26 07:36:01 Re: 8.5 release timetable, again