Re: [HACKERS] reprise: pretty print viewdefs

2012-01-16 Thread Andrew Dunstan
On 01/13/2012 02:50 PM, Andrew Dunstan wrote: On 01/13/2012 12:31 AM, Hitoshi Harada wrote: So my conclusion is it's better than nothing, but we could do better job here. From timeline perspective, it'd be ok to apply this patch and improve more later in 9.3+. I agree, let's look

Re: [HACKERS] reprise: pretty print viewdefs

2012-01-13 Thread Andrew Dunstan
On 01/13/2012 12:31 AM, Hitoshi Harada wrote: So my conclusion is it's better than nothing, but we could do better job here. From timeline perspective, it'd be ok to apply this patch and improve more later in 9.3+. I agree, let's look at the items other than the target list during

Re: [HACKERS] reprise: pretty print viewdefs

2012-01-12 Thread Hitoshi Harada
On Tue, Dec 27, 2011 at 8:02 AM, Andrew Dunstan and...@dunslane.net wrote: Updated, with docs and tests. Since the docs mark the versions of pg_get_viewdef() that take text as the first param as deprecated, I removed that variant of the new flavor. I left adding extra psql support to another

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-27 Thread Andrew Dunstan
On 12/22/2011 06:14 PM, Andrew Dunstan wrote: On 12/22/2011 06:11 PM, Andrew Dunstan wrote: On 12/22/2011 02:17 PM, Andrew Dunstan wrote: On 12/22/2011 01:05 PM, Tom Lane wrote: Maybe, though I fear it might complicate the ruleutils code a bit. You'd probably have to build the output

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-25 Thread Andrew Dunstan
On 12/24/2011 02:26 PM, Greg Stark wrote: On Thu, Dec 22, 2011 at 5:52 PM, Andrew Dunstanand...@dunslane.net wrote: I've looked at that, and it was discussed a bit previously. It's more complex because it requires that we keep track of (or calculate) where we are on the line, You might try

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-24 Thread Greg Stark
On Thu, Dec 22, 2011 at 5:52 PM, Andrew Dunstan and...@dunslane.net wrote: I've looked at that, and it was discussed a bit previously. It's more complex because it requires that we keep track of (or calculate) where we are on the line, You might try a compromise, just spit out all the columns

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-23 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: I *still* spend a lot of time editing in a 25x80 window. 80 is a good choice whatever the screen size, because it's about the most efficient text width as far as eyes movements are concerned: the eye is much better at going top-bottom than left-right.

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Robert Haas
On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstan and...@dunslane.net wrote: The simple solution I originally proposed to put a line feed and some space before every target field in pretty print mode. This is a two line patch. The downsides are a) maybe not everyone will like the change and b) it

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Andrew Dunstan
On 12/22/2011 12:18 PM, Robert Haas wrote: On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstanand...@dunslane.net wrote: The simple solution I originally proposed to put a line feed and some space before every target field in pretty print mode. This is a two line patch. The downsides are a)

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Andrew Dunstan
On 12/22/2011 12:52 PM, Andrew Dunstan wrote: On 12/22/2011 12:18 PM, Robert Haas wrote: On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstanand...@dunslane.net wrote: The simple solution I originally proposed to put a line feed and some space before every target field in pretty print mode.

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Robert Haas
On Thu, Dec 22, 2011 at 12:52 PM, Andrew Dunstan and...@dunslane.net wrote: I used to try to be conservative about vertical space, but in these days of scrollbars and screens not limited to 24 or 25 lines (Yes, kids, that's what some of us grew up with) that seems a bit old-fashioned. One of

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstan and...@dunslane.net wrote: The simple solution I originally proposed to put a line feed and some space before every target field in pretty print mode. This is a two line patch. The downsides are a) maybe

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Andrew Dunstan
On 12/22/2011 01:05 PM, Tom Lane wrote: Robert Haasrobertmh...@gmail.com writes: On Mon, Dec 19, 2011 at 1:51 PM, Andrew Dunstanand...@dunslane.net wrote: The simple solution I originally proposed to put a line feed and some space before every target field in pretty print mode. This is a

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Andrew Dunstan
On 12/22/2011 02:17 PM, Andrew Dunstan wrote: On 12/22/2011 01:05 PM, Tom Lane wrote: Maybe, though I fear it might complicate the ruleutils code a bit. You'd probably have to build the output for a column first and then see how long it is before deciding whether to insert a newline. In

Re: [HACKERS] reprise: pretty print viewdefs

2011-12-22 Thread Andrew Dunstan
On 12/22/2011 06:11 PM, Andrew Dunstan wrote: On 12/22/2011 02:17 PM, Andrew Dunstan wrote: On 12/22/2011 01:05 PM, Tom Lane wrote: Maybe, though I fear it might complicate the ruleutils code a bit. You'd probably have to build the output for a column first and then see how long it is

[HACKERS] reprise: pretty print viewdefs

2011-12-19 Thread Andrew Dunstan
A client has again raised with me the ugliness of pretty printed viewdefs. We looked at this a couple of years ago, but discussion went off into the weeds slightly, so I dropped it, but as requested I'm revisiting it. The problem can be simply seen in the screenshot here: