pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Further tweaking of print_aligned_vertical().
12+ messages / 4 participants
[nested] [flat]

* pgsql: Further tweaking of print_aligned_vertical().
@ 2015-12-01 19:47  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Tom Lane @ 2015-12-01 19:47 UTC (permalink / raw)
  To: pgsql-committers

Further tweaking of print_aligned_vertical().

Don't force the data width to extend all the way to the right margin if it
doesn't need to.  This reverts the behavior in non-wrapping cases to be
what it was in 9.4.  Also, make the logic that ensures the data line width
is at least equal to the record-header line width a little less obscure.

In passing, avoid possible calculation of log10(0).  Probably that's
harmless, given the lack of field complaints, but it seems risky:
conversion of NaN to an integer isn't well defined.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/181346cf9892820c94f51525d2c38684148812bf

Modified Files
--------------
src/bin/psql/print.c               |   56 ++++++++++++++++++++++--------------
src/test/regress/expected/psql.out |   40 +++++++++++++-------------
2 files changed, 55 insertions(+), 41 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* pgsql: Further tweaking of print_aligned_vertical().
@ 2015-12-01 19:47  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Tom Lane @ 2015-12-01 19:47 UTC (permalink / raw)
  To: pgsql-committers

Further tweaking of print_aligned_vertical().

Don't force the data width to extend all the way to the right margin if it
doesn't need to.  This reverts the behavior in non-wrapping cases to be
what it was in 9.4.  Also, make the logic that ensures the data line width
is at least equal to the record-header line width a little less obscure.

In passing, avoid possible calculation of log10(0).  Probably that's
harmless, given the lack of field complaints, but it seems risky:
conversion of NaN to an integer isn't well defined.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/95708e1d8e38bc1f7f6ee02c38dd86dd53b9663c

Modified Files
--------------
src/bin/psql/print.c               |   56 ++++++++++++++++++++++--------------
src/test/regress/expected/psql.out |   40 +++++++++++++-------------
2 files changed, 55 insertions(+), 41 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2015-12-02 01:16  Greg Stark <stark@mit.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 12+ messages in thread

From: Greg Stark @ 2015-12-02 01:16 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>

On 1 Dec 2015 19:48, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>
> In passing, avoid possible calculation of log10(0).  Probably that's
> harmless, given the lack of field complaints, but it seems risky:
> conversion of NaN to an integer isn't well defined.

Am I going to have to fire up the emulator again?

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2015-12-02 02:47  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Greg Stark <stark@mit.edu>
  1 sibling, 0 replies; 12+ messages in thread

From: Tom Lane @ 2015-12-02 02:47 UTC (permalink / raw)
  To: Greg Stark <stark@mit.edu>; +Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>

Greg Stark <stark@mit.edu> writes:
> On 1 Dec 2015 19:48, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> In passing, avoid possible calculation of log10(0).  Probably that's
>> harmless, given the lack of field complaints, but it seems risky:
>> conversion of NaN to an integer isn't well defined.

> Am I going to have to fire up the emulator again?

No, 'cause I fixed it ;-).  I initially thought that the case might
be unreachable, but it isn't: you can get there with cont->nrows == 0
if you have FETCH_SIZE set and the resultset size is an exact multiple
of FETCH_SIZE.

While poking at that, though, I ran into yet another bug in this code:

regression=# \pset format wrapped
Output format is wrapped.
regression=# \x
Expanded display is on.
regression=# select repeat('xyzzy',22) from generate_series(1,25);
-[ RECORD 1 ]------------------------------------------------------------------
repeat | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy.
       |.xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy
-[ RECORD 2 ]------------------------------------------------------------------
repeat | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy.
       |.xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy
.. etc etc ...

regression=# \set FETCH_COUNT 2
regression=# select repeat('xyzzy',22) from generate_series(1,25);
-[ RECORD 1 ]-------------------------------------------------------------------
---------------------------------------
repeat | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyx
yzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy
-[ RECORD 2 ]-------------------------------------------------------------------
---------------------------------------
repeat | xyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyx
yzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzyxyzzy
.. etc etc ...

That is, wrap width determination is broken the moment you set FETCH_SIZE.

The reason seems to be this ugly kluge in ExecQueryUsingCursor():

        else if (pset.queryFout == stdout && !did_pager)
        {
            /*
             * If query requires multiple result sets, hack to ensure that
             * only one pager instance is used for the whole mess
             */
            pset.queryFout = PageOutput(100000, &(my_popt.topt));
            did_pager = true;
        }

After we have run that code, pset.queryFout is no longer pointing at
stdout, which breaks every single one of the "fout == stdout" tests in
print.c.  It'd be all right if those tests knew that they were dealing
with an is_pager situation, but they don't because that critical piece of
information is not passed down to printQuery().  I think we could probably
fix this by making is_pager an additional argument of printQuery() and its
relevant subroutines.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2015-12-31 21:41  Bruce Momjian <bruce@momjian.us>
  parent: Greg Stark <stark@mit.edu>
  1 sibling, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2015-12-31 21:41 UTC (permalink / raw)
  To: Greg Stark <stark@mit.edu>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Wed, Dec  2, 2015 at 01:16:09AM +0000, Greg Stark wrote:
> 
> On 1 Dec 2015 19:48, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> >
> > In passing, avoid possible calculation of log10(0).  Probably that's
> > harmless, given the lack of field complaints, but it seems risky:
> > conversion of NaN to an integer isn't well defined.
> 
> Am I going to have to fire up the emulator again?

Greg's lightning talk in Vienna about how he got the emulator working
was priceless.  I know he posted the VAX results, but how he got them
was amazing.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Roman grave inscription                             +


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 06:16  Michael Paquier <michael.paquier@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Michael Paquier @ 2016-01-04 06:16 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Greg Stark <stark@mit.edu>; Tom Lane <tgl@sss.pgh.pa.us>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Fri, Jan 1, 2016 at 6:41 AM, Bruce Momjian <bruce@momjian.us> wrote:
> On Wed, Dec  2, 2015 at 01:16:09AM +0000, Greg Stark wrote:
>>
>> On 1 Dec 2015 19:48, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> >
>> > In passing, avoid possible calculation of log10(0).  Probably that's
>> > harmless, given the lack of field complaints, but it seems risky:
>> > conversion of NaN to an integer isn't well defined.
>>
>> Am I going to have to fire up the emulator again?
>
> Greg's lightning talk in Vienna about how he got the emulator working
> was priceless.  I know he posted the VAX results, but how he got them
> was amazing.

+1. The work of a pure hacker.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 06:22  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Tom Lane @ 2016-01-04 06:22 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Greg Stark <stark@mit.edu>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Michael Paquier <michael.paquier@gmail.com> writes:
> On Fri, Jan 1, 2016 at 6:41 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> Greg's lightning talk in Vienna about how he got the emulator working
>> was priceless.  I know he posted the VAX results, but how he got them
>> was amazing.

> +1. The work of a pure hacker.

Is this available online anywhere?

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 06:24  Michael Paquier <michael.paquier@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Michael Paquier @ 2016-01-04 06:24 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <bruce@momjian.us>; Greg Stark <stark@mit.edu>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Mon, Jan 4, 2016 at 3:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> On Fri, Jan 1, 2016 at 6:41 AM, Bruce Momjian <bruce@momjian.us> wrote:
>>> Greg's lightning talk in Vienna about how he got the emulator working
>>> was priceless.  I know he posted the VAX results, but how he got them
>>> was amazing.
>
>> +1. The work of a pure hacker.
>
> Is this available online anywhere?

Arg, actually it is not:
https://wiki.postgresql.org/wiki/PostgreSQL_Conference_Europe_Talks_2015
Greg could you add it there?
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 14:33  Greg Stark <stark@mit.edu>
  parent: Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Greg Stark @ 2016-01-04 14:33 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Bruce Momjian <bruce@momjian.us>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Mon, Jan 4, 2016 at 6:24 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Arg, actually it is not:
> https://wiki.postgresql.org/wiki/PostgreSQL_Conference_Europe_Talks_2015
> Greg could you add it there?

No, apparently that page is restricted to only some users.

I used plenty of images I pulled off the net without regard for
copyright so I hesitated to put it up. I suppose that's par for the
course with these kinds of presentations. In any case it was just a
quick lightning talk I threw together to describe a few days of mostly
waiting around for builds to finish. Here are the two lightning talks
on Google:

VAX (simh):
https://docs.google.com/presentation/d/1PG-bMU4WiS1pjtBwRvH4cE-nN9y5gj8ZLCO7KMrlvYg/view

Fuzzer:
https://docs.google.com/presentation/d/12Dd9Bhcugkdi2w0ye4T1fy9ccjconJEz9cNthdeyH7k/view

-- 
greg


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 18:18  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Greg Stark <stark@mit.edu>
  0 siblings, 2 replies; 12+ messages in thread

From: Tom Lane @ 2016-01-04 18:18 UTC (permalink / raw)
  To: Greg Stark <stark@mit.edu>; +Cc: Michael Paquier <michael.paquier@gmail.com>; Bruce Momjian <bruce@momjian.us>; PostgreSQL-development <pgsql-hackers@postgresql.org>

Greg Stark <stark@mit.edu> writes:
> I used plenty of images I pulled off the net without regard for
> copyright so I hesitated to put it up. I suppose that's par for the
> course with these kinds of presentations. In any case it was just a
> quick lightning talk I threw together to describe a few days of mostly
> waiting around for builds to finish. Here are the two lightning talks
> on Google:

> VAX (simh):
> https://docs.google.com/presentation/d/1PG-bMU4WiS1pjtBwRvH4cE-nN9y5gj8ZLCO7KMrlvYg/view

> Fuzzer:
> https://docs.google.com/presentation/d/12Dd9Bhcugkdi2w0ye4T1fy9ccjconJEz9cNthdeyH7k/view

Very cool, thanks!

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-04 19:01  Greg Stark <stark@mit.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 12+ messages in thread

From: Greg Stark @ 2016-01-04 19:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Michael Paquier <michael.paquier@gmail.com>; Bruce Momjian <bruce@momjian.us>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Mon, Jan 4, 2016 at 6:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> VAX (simh):
>> https://docs.google.com/presentation/d/1PG-bMU4WiS1pjtBwRvH4cE-nN9y5gj8ZLCO7KMrlvYg/view
>
>> Fuzzer:
>> https://docs.google.com/presentation/d/12Dd9Bhcugkdi2w0ye4T1fy9ccjconJEz9cNthdeyH7k/view
>
> Very cool, thanks!

Incidentally, I did boot up the simulator again the other day because
I had had an idea for how we might get the regression tests to pass.
However the idea didn't pan out. I thought maybe we could compile just
float.c with -msoft-float so that the backend used VAX floats and the
user datatype was represented by IEEE floats. I'm sure there are a few
places where we assume we can convert one to the other but I was
hoping it would be few enough to be manageable to fix up. I wasn't
sure how feasible it was to have a mixed build at all and I was going
to experiment.

However gcc doesn't support -msoft-float on VAX. Apparently
-msoft-float is an implemented by the architecture backend rather than
as a portable general purpose feature :(


-- 
greg


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: pgsql: Further tweaking of print_aligned_vertical().
@ 2016-01-18 02:15  Bruce Momjian <bruce@momjian.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 12+ messages in thread

From: Bruce Momjian @ 2016-01-18 02:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Greg Stark <stark@mit.edu>; Michael Paquier <michael.paquier@gmail.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>

On Mon, Jan  4, 2016 at 01:18:02PM -0500, Tom Lane wrote:
> Greg Stark <stark@mit.edu> writes:
> > I used plenty of images I pulled off the net without regard for
> > copyright so I hesitated to put it up. I suppose that's par for the
> > course with these kinds of presentations. In any case it was just a
> > quick lightning talk I threw together to describe a few days of mostly
> > waiting around for builds to finish. Here are the two lightning talks
> > on Google:
> 
> > VAX (simh):
> > https://docs.google.com/presentation/d/1PG-bMU4WiS1pjtBwRvH4cE-nN9y5gj8ZLCO7KMrlvYg/view
> 
> > Fuzzer:
> > https://docs.google.com/presentation/d/12Dd9Bhcugkdi2w0ye4T1fy9ccjconJEz9cNthdeyH7k/view
> 
> Very cool, thanks!

No, you need to see the video!  It was amazing.  I couldn't believe what
I was hearing.  I was like "YOU DID WHAT!"  Unfortunately, I don't think
it was recorded.  :-(

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Roman grave inscription                             +


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2016-01-18 02:15 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 19:47 pgsql: Further tweaking of print_aligned_vertical(). Tom Lane <tgl@sss.pgh.pa.us>
2015-12-01 19:47 pgsql: Further tweaking of print_aligned_vertical(). Tom Lane <tgl@sss.pgh.pa.us>
2015-12-02 01:16 ` Greg Stark <stark@mit.edu>
2015-12-02 02:47   ` Tom Lane <tgl@sss.pgh.pa.us>
2015-12-31 21:41   ` Bruce Momjian <bruce@momjian.us>
2016-01-04 06:16     ` Michael Paquier <michael.paquier@gmail.com>
2016-01-04 06:22       ` Tom Lane <tgl@sss.pgh.pa.us>
2016-01-04 06:24         ` Michael Paquier <michael.paquier@gmail.com>
2016-01-04 14:33           ` Greg Stark <stark@mit.edu>
2016-01-04 18:18             ` Tom Lane <tgl@sss.pgh.pa.us>
2016-01-04 19:01               ` Greg Stark <stark@mit.edu>
2016-01-18 02:15               ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox