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

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 (view raw or flat)
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: prettyprint.patch
Description: text/x-patch (598 bytes)

pgsql-hackers by date

Next: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
Previous:From: Rick GiggerDate: 2009-08-26 07:36:01
Subject: Re: 8.5 release timetable, again

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