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pbGQ/DQoNCg0KDQpDdXJyZW50bHkgaW5zdGFsbGVkOg0K IyBzZWxlY3QgdmVyc2lvbigpOw0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHZlcnNpb24NCi0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiBQb3N0Z3JlU1FM IDEwZGV2ZWwgb24gaTM4Ni11bmtub3duLW9wZW5ic2Q2LjAsIGNvbXBpbGVk IGJ5IGdjYyAoR0NDKSA0LjIuMQoyMDA3MDcxOSAsIDMyLWJpdA0KDQoNCg0K VGhhbmtzLA0KU2VhbgoK
jungleboogie0+psql@gmail.com wrote: > gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement > -Wendif-labels -Wmissing-format-attribute -Wformat-security > -fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq > -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include > -I/usr/local/include -c -o vacuumdb.o vacuumdb.c > vacuumdb.c:70: error: expected declaration specifiers or '...' before > 'fd_set' > vacuumdb.c: In function 'main': > vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this > function) What does your select(2) manpage say about what includes are required? My manpage says /* According to POSIX.1-2001 */ #include <sys/select.h> /* According to earlier standards */ #include <sys/time.h> #include <sys/types.h> #include <unistd.h> and we're not including <sys/select.h> anywhere that I can see; apparently we should add something like #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Hi Alvaro, On 21 September 2016 at 10:57, Alvaro Herrera <alvherre@2ndquadrant.com> wr= ote: > jungleboogie0+psql@gmail.com wrote: > >> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-state= ment >> -Wendif-labels -Wmissing-format-attribute -Wformat-security >> -fno-strict-aliasing -fwrapv -g -O2 -I../../../src/interfaces/libpq >> -I../../../src/include -I/usr/local/include/libxml2 -I/usr/local/include >> -I/usr/local/include -c -o vacuumdb.o vacuumdb.c >> vacuumdb.c:70: error: expected declaration specifiers or '...' before >> 'fd_set' >> vacuumdb.c: In function 'main': >> vacuumdb.c:193: error: 'FD_SETSIZE' undeclared (first use in this >> function) > > What does your select(2) manpage say about what includes are required? > My manpage says > > /* According to POSIX.1-2001 */ > #include <sys/select.h> > > /* According to earlier standards */ > #include <sys/time.h> > #include <sys/types.h> > #include <unistd.h> > http://man.openbsd.org/OpenBSD-current/man2/select.2 Also has #include <sys/select.h> I'm checking out commit https://github.com/postgres/postgres/commit/be7f7ee5ea73626c037600b515087e8= f98038140 (day for the vacuum changes) to see if this will build. If not, maybe it was a change within openbsd. > and we're not including <sys/select.h> anywhere that I can see; > apparently we should add something like > > #ifdef HAVE_SYS_SELECT_H > #include <sys/select.h> > #endif > > -- > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --=20 ------- inum: 883510009027723 sip: jungleboogie@sip2sip.info
jungle Boogie wrote: > http://man.openbsd.org/OpenBSD-current/man2/select.2 > > Also has #include <sys/select.h> So "current" is 6.0? We don't have a lot of OpenBSD machines in the buildfarm; would you be able to contribute one? The one we have (curculio) runs 5.9 and has been running fine with the committed code. https://wiki.postgresql.org/wiki/Buildfarm It makes portability work easier if we see right away that a commit has broken something. Can you try HEAD with the following patch applied and let me know if it works? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Вложения
Hi Alvaro, On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wr= ote: > jungle Boogie wrote: > >> http://man.openbsd.org/OpenBSD-current/man2/select.2 >> >> Also has #include <sys/select.h> > > So "current" is 6.0? We don't have a lot of OpenBSD machines in the > buildfarm; would you be able to contribute one? The one we have > (curculio) runs 5.9 and has been running fine with the committed code. > https://wiki.postgresql.org/wiki/Buildfarm > 6.0 is a release version and will only receive patches for the base OS. -current/snapshot is what I'm running and it's the development version of openbsd. In a few months, current will be marked and released as 6.1. Basically I'm following the development branch of OpenBSD: http://www.openbsd.org/faq/current.html > It makes portability work easier if we see right away that a commit has > broken something. > > Can you try HEAD with the following patch applied and let me know if it > works? I wrote to the maintainer of postgresql on openbsd and asked if he could take a look at this email and see if he can reproduce the problem. Meanwhile, I came across this. It looks like 8 days ago select.h was modified, but I have no idea if this is causing the postgresql failure. http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h I will checkout buildfarm and see what it takes to run it! > > -- > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --=20 ------- inum: 883510009027723 sip: jungleboogie@sip2sip.info
jungle Boogie wrote: > Hi Alvaro, > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > So "current" is 6.0? We don't have a lot of OpenBSD machines in the > > buildfarm; would you be able to contribute one? The one we have > > (curculio) runs 5.9 and has been running fine with the committed code. > > https://wiki.postgresql.org/wiki/Buildfarm > > 6.0 is a release version and will only receive patches for the base OS. I see. > -current/snapshot is what I'm running and it's the development version > of openbsd. In a few months, current will be marked and released as > 6.1. Basically I'm following the development branch of OpenBSD: > http://www.openbsd.org/faq/current.html I think it'd be valuable to have a system running something that tracks "current"; we already have a few "rolling" Linux distros and this seems similar in spirit. It might even provide more feedback for those crazy patches ... > > Can you try HEAD with the following patch applied and let me know if it > > works? > > I wrote to the maintainer of postgresql on openbsd and asked if he > could take a look at this email and see if he can reproduce the > problem. Good. > Meanwhile, I came across this. > It looks like 8 days ago select.h was modified, but I have no idea if > this is causing the postgresql failure. > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/select.h Sounds very likely to me. > I will checkout buildfarm and see what it takes to run it! Great. It's just a cron Perl script that builds Postgres and runs the tests (plus a commitment that you'll give a look in case things fail for odd reasons. We try not to bother you if your animal finds portability issues in Postgres.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > Can you try HEAD with the following patch applied and let me know if it > works? Your patch works!! You probably made the patch on a Windows system because there were ^M characters but I copied your three lines to vacuumdb.c and recompiled. Is there a method to report the exact git commit postgresql is running? -- ------- inum: 883510009027723 sip: jungleboogie@sip2sip.info
jungle Boogie wrote: > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > Can you try HEAD with the following patch applied and let me know if it > > works? > > Your patch works!! > > You probably made the patch on a Windows system because there were ^M > characters but I copied your three lines to vacuumdb.c and recompiled. Windows!?!? I haven't touched that in two decades now (oh my). I just ":read" the patch file into the email body instead of using an attachment. I got lazy there, sorry about that. Anyway thanks for following up. I will push this, probably tomorrow. > Is there a method to report the exact git commit postgresql is running? Not that I know of. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Alvaro Herrera wrote: > jungle Boogie wrote: > > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > > Can you try HEAD with the following patch applied and let me know if it > > > works? > > > > Your patch works!! > > > > You probably made the patch on a Windows system because there were ^M > > characters but I copied your three lines to vacuumdb.c and recompiled. > Anyway thanks for following up. I will push this, probably tomorrow. It took me a few more days than I intended, which meant this missed 9.6.0, but it's out now. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On 26 September 2016 at 21:09, Alvaro Herrera <alvherre@2ndquadrant.com> wr= ote: > Alvaro Herrera wrote: >> jungle Boogie wrote: >> > On 21 September 2016 at 12:22, Alvaro Herrera <alvherre@2ndquadrant.co= m> wrote: >> > > Can you try HEAD with the following patch applied and let me know if= it >> > > works? >> > >> > Your patch works!! >> > >> > You probably made the patch on a Windows system because there were ^M >> > characters but I copied your three lines to vacuumdb.c and recompiled. > >> Anyway thanks for following up. I will push this, probably tomorrow. > > It took me a few more days than I intended, which meant this missed > 9.6.0, but it's out now. > I don't know what the will mean in terms of the OpenBSD package/port of it, but I'll let the maintainer know that it's now patched in Postgres. By the way, I updated to Postgres' master and installed without problems. Thanks for quickly patching it! I haven't forgotten about the buildfarm! Best, sean > -- > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --=20 ------- inum: 883510009027723 sip: jungleboogie@sip2sip.info