cosmetic psql tweaks

Started by Neil Conwayover 22 years ago3 messagespatches
Jump to latest
#1Neil Conway
neilc@samurai.com

As the subject says -- I've applied this patch to HEAD.

-Neil

Attachments:

psql-print-query-cosmetic-1.patchtext/plain; name=psql-print-query-cosmetic-1.patch; x-mac-creator=0; x-mac-type=0Download+21-19
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#1)
Re: cosmetic psql tweaks

Neil Conway <neilc@samurai.com> writes:

printTable(opt->title, headers, cells,
! footers ? (const char *const *) footers : (const char *const *) (opt->footers),
align, &opt->topt, fout);

printTable(opt->title, headers, cells,
! (const char *const *) footers,
align, &opt->topt, fout);

Er, doesn't that change the behavior?

regards, tom lane

#3Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#2)
Re: cosmetic psql tweaks

Tom Lane wrote:

Er, doesn't that change the behavior?

I don't believe so. There is an if statement earlier that assigns
opt->footers to footers is the former is non-NULL. In other words:

if (opt->footers)
footers = opt->footers;
else if (...)
footers = xyz();
else
footers = NULL;

Therefore if footers is NULL then opt->footers must also be NULL, so the
previous trinary statement is just confusing.

-Neil