pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Incorrect include file order in guc-file.l
9+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2022-11-05 2a71de8915  Remove unneeded includes of <sys/stat.h>
  2022-11-04 233cf6e8ad  Remove outdated include
  2022-11-03 062eef3a9b  Straighten include order in guc-file.l
* Incorrect include file order in guc-file.l
@ 2022-11-02 05:29 Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2022-11-02 05:29 UTC (permalink / raw)
  To: Postgres hackers <pgsql-hackers@lists.postgresql.org>

Hi all,

While reviewing a different patch, I have noticed that guc-file.l
includes sys/stat.h in the middle of the PG internal headers.  The
usual practice is to have first postgres[_fe].h, followed by the
system headers and finally the internal headers.  That's a nit, but
all the other files do that.

{be,fe}-secure-openssl.c include some exceptions though, as documented
there.

Thoughts?
--
Michael

Attachments:

gucfile-include.patch (text/x-diff, 489B) download diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 2436396306..caa9c902b9 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -10,6 +10,7 @@ #include "postgres.h" #include <ctype.h> +#include <sys/stat.h> #include <unistd.h> #include "common/file_utils.h" @@ -17,7 +18,6 @@ #include "mb/pg_wchar.h" #include "miscadmin.h" #include "storage/fd.h" -#include <sys/stat.h> #include "utils/memutils.h" }
signature.asc (application/pgp-signature, 832B) download ^ permalink raw reply [nested|flat] 9+ messages in thread

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
@ 2022-11-02 06:01 ` Julien Rouhaud <rjuju123@gmail.com>
  2022-11-02 06:53   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Julien Rouhaud @ 2022-11-02 06:01 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

Hi,

On Wed, Nov 02, 2022 at 02:29:50PM +0900, Michael Paquier wrote:
>
> While reviewing a different patch, I have noticed that guc-file.l
> includes sys/stat.h in the middle of the PG internal headers.  The
> usual practice is to have first postgres[_fe].h, followed by the
> system headers and finally the internal headers.  That's a nit, but
> all the other files do that.
>
> {be,fe}-secure-openssl.c include some exceptions though, as documented
> there.

Agreed, it's apparently an oversight in dac048f71eb.  +1 for the patch.





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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
@ 2022-11-02 06:53   ` John Naylor <john.naylor@enterprisedb.com>
  1 sibling, 0 replies; 9+ messages in thread

From: John Naylor @ 2022-11-02 06:53 UTC (permalink / raw)
  To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Nov 2, 2022 at 1:01 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> Hi,
>
> On Wed, Nov 02, 2022 at 02:29:50PM +0900, Michael Paquier wrote:
> >
> > While reviewing a different patch, I have noticed that guc-file.l
> > includes sys/stat.h in the middle of the PG internal headers.  The
> > usual practice is to have first postgres[_fe].h, followed by the
> > system headers and finally the internal headers.  That's a nit, but
> > all the other files do that.
> >
> > {be,fe}-secure-openssl.c include some exceptions though, as documented
> > there.
>
> Agreed, it's apparently an oversight in dac048f71eb.  +1 for the patch.

Yeah. +1, thanks.

--
John Naylor
EDB: http://www.enterprisedb.com

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
@ 2022-11-03 05:40   ` John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 11:40     ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 9+ messages in thread

From: John Naylor @ 2022-11-03 05:40 UTC (permalink / raw)
  To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Nov 2, 2022 at 1:01 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> Hi,
>
> On Wed, Nov 02, 2022 at 02:29:50PM +0900, Michael Paquier wrote:
> >
> > While reviewing a different patch, I have noticed that guc-file.l
> > includes sys/stat.h in the middle of the PG internal headers.  The
> > usual practice is to have first postgres[_fe].h, followed by the
> > system headers and finally the internal headers.  That's a nit, but
> > all the other files do that.
> >
> > {be,fe}-secure-openssl.c include some exceptions though, as documented
> > there.
>
> Agreed, it's apparently an oversight in dac048f71eb.  +1 for the patch.

I've pushed this, thanks!

--
John Naylor
EDB: http://www.enterprisedb.com

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
@ 2022-11-03 11:40     ` Michael Paquier <michael@paquier.xyz>
  2022-11-03 12:19       ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2022-11-03 11:40 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Thu, Nov 03, 2022 at 12:40:19PM +0700, John Naylor wrote:
> On Wed, Nov 2, 2022 at 1:01 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>> Agreed, it's apparently an oversight in dac048f71eb.  +1 for the patch.
> 
> I've pushed this, thanks!

Thanks for the commit.  I've wanted to get it done yesterday but life
took over faster than that.  Before committing the change, there is
something I have noticed though: this header does not seem to be
necessary at all and it looks that there is nothing in guc-file.l that
needs it.  Why did you add it in dac048f to begin with?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 11:40     ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
@ 2022-11-03 12:19       ` John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 22:42         ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 9+ messages in thread

From: John Naylor @ 2022-11-03 12:19 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Thu, Nov 3, 2022 at 6:40 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Thu, Nov 03, 2022 at 12:40:19PM +0700, John Naylor wrote:
> > On Wed, Nov 2, 2022 at 1:01 PM Julien Rouhaud <rjuju123@gmail.com>
wrote:
> >> Agreed, it's apparently an oversight in dac048f71eb.  +1 for the patch.
> >
> > I've pushed this, thanks!
>
> Thanks for the commit.  I've wanted to get it done yesterday but life
> took over faster than that.  Before committing the change, there is
> something I have noticed though: this header does not seem to be
> necessary at all and it looks that there is nothing in guc-file.l that
> needs it.  Why did you add it in dac048f to begin with?

Because it wouldn't compile otherwise, obviously. :-)

I must have been working on it before bfb9dfd93720

--
John Naylor
EDB: http://www.enterprisedb.com

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 11:40     ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-03 12:19       ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
@ 2022-11-03 22:42         ` Michael Paquier <michael@paquier.xyz>
  2022-11-04 00:55           ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2022-11-03 22:42 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Thu, Nov 03, 2022 at 07:19:07PM +0700, John Naylor wrote:
> Because it wouldn't compile otherwise, obviously. :-)
> 
> I must have been working on it before bfb9dfd93720

Hehe, my fault then ;p

The CI is able to complete without it.  Would you mind if it is
removed?  If you don't want us to poke more at the bear, that's a nit
so leaving things as they are is also fine by me.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 11:40     ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-03 12:19       ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 22:42         ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
@ 2022-11-04 00:55           ` John Naylor <john.naylor@enterprisedb.com>
  2022-11-05 03:34             ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 9+ messages in thread

From: John Naylor @ 2022-11-04 00:55 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Fri, Nov 4, 2022 at 5:42 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> The CI is able to complete without it.  Would you mind if it is
> removed?  If you don't want us to poke more at the bear, that's a nit
> so leaving things as they are is also fine by me.

I've removed it.

--
John Naylor
EDB: http://www.enterprisedb.com

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

* Re: Incorrect include file order in guc-file.l
  2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-02 06:01 ` Re: Incorrect include file order in guc-file.l Julien Rouhaud <rjuju123@gmail.com>
  2022-11-03 05:40   ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 11:40     ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-03 12:19       ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
  2022-11-03 22:42         ` Re: Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
  2022-11-04 00:55           ` Re: Incorrect include file order in guc-file.l John Naylor <john.naylor@enterprisedb.com>
@ 2022-11-05 03:34             ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 9+ messages in thread

From: Michael Paquier @ 2022-11-05 03:34 UTC (permalink / raw)
  To: John Naylor <john.naylor@enterprisedb.com>; +Cc: Julien Rouhaud <rjuju123@gmail.com>; Postgres hackers <pgsql-hackers@lists.postgresql.org>

On Fri, Nov 04, 2022 at 07:55:20AM +0700, John Naylor wrote:
> I've removed it.

Thanks.

Aha, there were three more of these, as of rewriteheap.c, copydir.c
and pgtz.c that I also forgot to clean up in bfb9dfd..
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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


end of thread, other threads:[~2022-11-05 03:34 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 05:29 Incorrect include file order in guc-file.l Michael Paquier <michael@paquier.xyz>
2022-11-02 06:01 ` Julien Rouhaud <rjuju123@gmail.com>
2022-11-02 06:53   ` John Naylor <john.naylor@enterprisedb.com>
2022-11-03 05:40   ` John Naylor <john.naylor@enterprisedb.com>
2022-11-03 11:40     ` Michael Paquier <michael@paquier.xyz>
2022-11-03 12:19       ` John Naylor <john.naylor@enterprisedb.com>
2022-11-03 22:42         ` Michael Paquier <michael@paquier.xyz>
2022-11-04 00:55           ` John Naylor <john.naylor@enterprisedb.com>
2022-11-05 03:34             ` Michael Paquier <michael@paquier.xyz>

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