Re: newlines at end of generated SQL

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: newlines at end of generated SQL
Date: 2014-01-09 03:17:02
Message-ID: 1389237422.30068.10.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Is there a reason why the programs in src/bin/scripts all put newlines
at the end of the SQL commands they generate? This produces useless
empty lines in the server log (and client output, if selected).


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: newlines at end of generated SQL
Date: 2014-01-09 17:34:34
Message-ID: CA+TgmobYrOMngtOA_c7ZzDT5LqpGrPQpNesbJBH3TEw_kTSu5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jan 8, 2014 at 10:17 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Is there a reason why the programs in src/bin/scripts all put newlines
> at the end of the SQL commands they generate? This produces useless
> empty lines in the server log (and client output, if selected).

If you're asking whether you can go ahead and fix that, +1 from me.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: newlines at end of generated SQL
Date: 2014-01-09 17:52:06
Message-ID: CAFcNs+pAQVyvnEqs_v8Gqej29fqxauW=4KNtk7X=8Uw2v7AViQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jan 9, 2014 at 3:34 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Wed, Jan 8, 2014 at 10:17 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > Is there a reason why the programs in src/bin/scripts all put newlines
> > at the end of the SQL commands they generate? This produces useless
> > empty lines in the server log (and client output, if selected).
>
> If you're asking whether you can go ahead and fix that, +1 from me.
>

Well... I did that...

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
remove-new-line-at-end-of-scripts_v1.patch text/x-diff 5.1 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: fabriziomello(at)gmail(dot)com
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: newlines at end of generated SQL
Date: 2014-01-11 03:21:47
Message-ID: 1389410507.12505.5.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2014-01-09 at 15:52 -0200, Fabrízio de Royes Mello wrote:
>
> On Thu, Jan 9, 2014 at 3:34 PM, Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
> >
> > On Wed, Jan 8, 2014 at 10:17 PM, Peter Eisentraut <peter_e(at)gmx(dot)net>
> wrote:
> > > Is there a reason why the programs in src/bin/scripts all put
> newlines
> > > at the end of the SQL commands they generate? This produces
> useless
> > > empty lines in the server log (and client output, if selected).
> >
> > If you're asking whether you can go ahead and fix that, +1 from me.
> >
>
> Well... I did that...

But you also need to add the newlines back for the --echo output.
(Might as well use puts() then.)


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: newlines at end of generated SQL
Date: 2014-01-11 19:23:46
Message-ID: CAFcNs+qSKJdv6fBB5M7HB4H4rad99iZPL5ZvXmJXPmg2UiS0jg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Jan 11, 2014 at 1:21 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
> On Thu, 2014-01-09 at 15:52 -0200, Fabrízio de Royes Mello wrote:
> >
> > On Thu, Jan 9, 2014 at 3:34 PM, Robert Haas <robertmhaas(at)gmail(dot)com>
> > wrote:
> > >
> > > On Wed, Jan 8, 2014 at 10:17 PM, Peter Eisentraut <peter_e(at)gmx(dot)net>
> > wrote:
> > > > Is there a reason why the programs in src/bin/scripts all put
> > newlines
> > > > at the end of the SQL commands they generate? This produces
> > useless
> > > > empty lines in the server log (and client output, if selected).
> > >
> > > If you're asking whether you can go ahead and fix that, +1 from me.
> > >
> >
> > Well... I did that...
>
> But you also need to add the newlines back for the --echo output.
> (Might as well use puts() then.)
>

Done!

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
remove-new-line-at-end-of-scripts_v2.patch text/x-diff 6.9 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: fabriziomello(at)gmail(dot)com
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: newlines at end of generated SQL
Date: 2014-02-11 02:51:28
Message-ID: 1392087088.14377.0.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

committed