Skip site navigation (1) Skip section navigation (2)

pretty print viewdefs

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pretty print viewdefs
Date: 2009-08-26 14:02:33
Message-ID: 4A954079.9060704@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers
[originally sent from wrong account :-( ]


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: prettyprint.patch
Description: text/x-patch (599 bytes)

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2009-08-26 14:07:33
Subject: Re: PostgreSQL does CAST implicitely between int and a domain derived from int during SELECT query
Previous:From: Jean-Michel PouréDate: 2009-08-26 13:52:38
Subject: PostgreSQL does CAST implicitely between int and a domain derived from int during SELECT query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group