Re: Trouble building 8.1.1 on Tru64 UNIX 5.1 - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Trouble building 8.1.1 on Tru64 UNIX 5.1
Date
Msg-id 200512230014.jBN0Enx05370@candle.pha.pa.us
Whole thread Raw
List pgsql-patches
Albert Chin wrote:
> On Mon, Dec 19, 2005 at 06:34:38PM -0500, Tom Lane wrote:
> > Albert Chin <pgsql-hackers@mlists.thewrittenword.com> writes:
> > > On Mon, Dec 19, 2005 at 05:59:12PM -0500, Tom Lane wrote:
> > >> Perhaps a more relevant question is why ecpg/preproc is including
> > >> that header.
> >
> > > #include <netdb.h> with -D_REENTRANT includes it.
> > >   preproc.c:
> > >     #include "postgres_fe.h"
> > >       #include "c.h"
> > >         #include "port.h"
> > >            #include <netdb.h>
> >
> > Well, port.h is certainly doing a fine job of polluting the namespace.
> > Maybe we should pull out the stuff that depends on netdb.h and pwd.h
> > into some other header that isn't going to get included so widely.
> >
> > > ADD has the same problem.
> >
> > There's no way that we are going to be able to dodge every single symbol
> > that any random system header on any random platform might define ---
> > especially when you get into the less-well-standardized headers like
> > these.  We have to think smaller in terms of what headers we include
> > everywhere.
>
> Well, we've built on most versions of Solaris, HP-UX, AIX, Tru64 UNIX,
> Redhat Linux, and IRIX and this is the only symbol conflict we ran
> into. So, it's not a big problem.

I have converted the symbols that gave you problem (HEAD/ADD) to
HEAD_P/ADD_P.  Please test the patch and let me know if things work.
Thanks.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/parser/gram.y
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.517
diff -c -c -r2.517 gram.y
*** src/backend/parser/gram.y    11 Dec 2005 10:54:27 -0000    2.517
--- src/backend/parser/gram.y    23 Dec 2005 00:12:46 -0000
***************
*** 335,341 ****
   */

  /* ordinary key words in alphabetical order */
! %token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD ADMIN AFTER
      AGGREGATE ALL ALSO ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC
      ASSERTION ASSIGNMENT ASYMMETRIC AT AUTHORIZATION

--- 335,341 ----
   */

  /* ordinary key words in alphabetical order */
! %token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER
      AGGREGATE ALL ALSO ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC
      ASSERTION ASSIGNMENT ASYMMETRIC AT AUTHORIZATION

***************
*** 361,367 ****

      GLOBAL GRANT GRANTED GREATEST GROUP_P

!     HANDLER HAVING HEADER HOLD HOUR_P

      IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCLUDING INCREMENT
      INDEX INHERIT INHERITS INITIALLY INNER_P INOUT INPUT_P
--- 361,367 ----

      GLOBAL GRANT GRANTED GREATEST GROUP_P

!     HANDLER HAVING HEADER_P HOLD HOUR_P

      IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCLUDING INCREMENT
      INDEX INHERIT INHERITS INITIALLY INNER_P INOUT INPUT_P
***************
*** 878,884 ****
                  }
          ;

! add_drop:    ADD                                        { $$ = +1; }
              | DROP                                    { $$ = -1; }
          ;

--- 878,884 ----
                  }
          ;

! add_drop:    ADD_P                                        { $$ = +1; }
              | DROP                                    { $$ = -1; }
          ;

***************
*** 1300,1307 ****

  /* Subcommands that are for ALTER TABLE only */
  alter_table_cmd:
!             /* ALTER TABLE <relation> ADD [COLUMN] <coldef> */
!             ADD opt_column columnDef
                  {
                      AlterTableCmd *n = makeNode(AlterTableCmd);
                      n->subtype = AT_AddColumn;
--- 1300,1307 ----

  /* Subcommands that are for ALTER TABLE only */
  alter_table_cmd:
!             /* ALTER TABLE <relation> ADD_P [COLUMN] <coldef> */
!             ADD_P opt_column columnDef
                  {
                      AlterTableCmd *n = makeNode(AlterTableCmd);
                      n->subtype = AT_AddColumn;
***************
*** 1373,1380 ****
                      n->transform = $6;
                      $$ = (Node *)n;
                  }
!             /* ALTER TABLE <relation> ADD CONSTRAINT ... */
!             | ADD TableConstraint
                  {
                      AlterTableCmd *n = makeNode(AlterTableCmd);
                      n->subtype = AT_AddConstraint;
--- 1373,1380 ----
                      n->transform = $6;
                      $$ = (Node *)n;
                  }
!             /* ALTER TABLE <relation> ADD_P CONSTRAINT ... */
!             | ADD_P TableConstraint
                  {
                      AlterTableCmd *n = makeNode(AlterTableCmd);
                      n->subtype = AT_AddConstraint;
***************
*** 1615,1621 ****
                  {
                      $$ = makeDefElem("csv", (Node *)makeInteger(TRUE));
                  }
!             | HEADER
                  {
                      $$ = makeDefElem("header", (Node *)makeInteger(TRUE));
                  }
--- 1615,1621 ----
                  {
                      $$ = makeDefElem("csv", (Node *)makeInteger(TRUE));
                  }
!             | HEADER_P
                  {
                      $$ = makeDefElem("header", (Node *)makeInteger(TRUE));
                  }
***************
*** 4763,4770 ****
                      n->typename = $3;
                      $$ = (Node *)n;
                  }
!             /* ALTER DOMAIN <domain> ADD CONSTRAINT ... */
!             | ALTER DOMAIN_P any_name ADD TableConstraint
                  {
                      AlterDomainStmt *n = makeNode(AlterDomainStmt);
                      n->subtype = 'C';
--- 4763,4770 ----
                      n->typename = $3;
                      $$ = (Node *)n;
                  }
!             /* ALTER DOMAIN <domain> ADD_P CONSTRAINT ... */
!             | ALTER DOMAIN_P any_name ADD_P TableConstraint
                  {
                      AlterDomainStmt *n = makeNode(AlterDomainStmt);
                      n->subtype = 'C';
***************
*** 8133,8139 ****
              | ABSOLUTE_P
              | ACCESS
              | ACTION
!             | ADD
              | ADMIN
              | AFTER
              | AGGREGATE
--- 8133,8139 ----
              | ABSOLUTE_P
              | ACCESS
              | ACTION
!             | ADD_P
              | ADMIN
              | AFTER
              | AGGREGATE
***************
*** 8200,8206 ****
              | GLOBAL
              | GRANTED
              | HANDLER
!             | HEADER
              | HOLD
              | HOUR_P
              | IF_P
--- 8200,8206 ----
              | GLOBAL
              | GRANTED
              | HANDLER
!             | HEADER_P
              | HOLD
              | HOUR_P
              | IF_P
Index: src/backend/parser/keywords.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/keywords.c,v
retrieving revision 1.169
diff -c -c -r1.169 keywords.c
*** src/backend/parser/keywords.c    22 Nov 2005 18:17:15 -0000    1.169
--- src/backend/parser/keywords.c    23 Dec 2005 00:12:46 -0000
***************
*** 34,40 ****
      {"absolute", ABSOLUTE_P},
      {"access", ACCESS},
      {"action", ACTION},
!     {"add", ADD},
      {"admin", ADMIN},
      {"after", AFTER},
      {"aggregate", AGGREGATE},
--- 34,40 ----
      {"absolute", ABSOLUTE_P},
      {"access", ACCESS},
      {"action", ACTION},
!     {"add", ADD_P},
      {"admin", ADMIN},
      {"after", AFTER},
      {"aggregate", AGGREGATE},
***************
*** 157,163 ****
      {"group", GROUP_P},
      {"handler", HANDLER},
      {"having", HAVING},
!     {"header", HEADER},
      {"hold", HOLD},
      {"hour", HOUR_P},
      {"if", IF_P},
--- 157,163 ----
      {"group", GROUP_P},
      {"handler", HANDLER},
      {"having", HAVING},
!     {"header", HEADER_P},
      {"hold", HOLD},
      {"hour", HOUR_P},
      {"if", IF_P},
Index: src/interfaces/ecpg/preproc/keywords.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v
retrieving revision 1.70
diff -c -c -r1.70 keywords.c
*** src/interfaces/ecpg/preproc/keywords.c    15 Oct 2005 02:49:47 -0000    1.70
--- src/interfaces/ecpg/preproc/keywords.c    23 Dec 2005 00:12:52 -0000
***************
*** 32,38 ****
      {"absolute", ABSOLUTE_P},
      {"access", ACCESS},
      {"action", ACTION},
!     {"add", ADD},
      {"admin", ADMIN},
      {"after", AFTER},
      {"aggregate", AGGREGATE},
--- 32,38 ----
      {"absolute", ABSOLUTE_P},
      {"access", ACCESS},
      {"action", ACTION},
!     {"add", ADD_P},
      {"admin", ADMIN},
      {"after", AFTER},
      {"aggregate", AGGREGATE},
***************
*** 155,161 ****
      {"group", GROUP_P},
      {"handler", HANDLER},
      {"having", HAVING},
!     {"header", HEADER},
      {"hold", HOLD},
      {"hour", HOUR_P},
      {"ilike", ILIKE},
--- 155,161 ----
      {"group", GROUP_P},
      {"handler", HANDLER},
      {"having", HAVING},
!     {"header", HEADER_P},
      {"hold", HOLD},
      {"hour", HOUR_P},
      {"ilike", ILIKE},
Index: src/interfaces/ecpg/preproc/preproc.y
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/preproc/preproc.y,v
retrieving revision 1.313
diff -c -c -r1.313 preproc.y
*** src/interfaces/ecpg/preproc/preproc.y    2 Dec 2005 15:03:57 -0000    1.313
--- src/interfaces/ecpg/preproc/preproc.y    23 Dec 2005 00:12:55 -0000
***************
*** 349,355 ****
  %token    TYPECAST

  /* ordinary key words in alphabetical order */
! %token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD ADMIN AFTER
          AGGREGATE ALL ALSO ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC
      ASSERTION ASSIGNMENT ASYMMETRIC AT AUTHORIZATION

--- 349,355 ----
  %token    TYPECAST

  /* ordinary key words in alphabetical order */
! %token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD_P ADMIN AFTER
          AGGREGATE ALL ALSO ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC
      ASSERTION ASSIGNMENT ASYMMETRIC AT AUTHORIZATION

***************
*** 375,381 ****

      GET GLOBAL GRANT GRANTED GREATEST GROUP_P

!     HANDLER HAVING HEADER HOLD HOUR_P

      ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCLUDING INCREMENT
      INDEX INHERIT INHERITS INITIALLY INNER_P INOUT INPUT_P
--- 375,381 ----

      GET GLOBAL GRANT GRANTED GREATEST GROUP_P

!     HANDLER HAVING HEADER_P HOLD HOUR_P

      ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IN_P INCLUDING INCREMENT
      INDEX INHERIT INHERITS INITIALLY INNER_P INOUT INPUT_P
***************
*** 1032,1038 ****
              { $$ = cat_str(5, make_str("alter group"), $3, $4, make_str("user"), $6); }
          ;

! add_drop: ADD        { $$ = make_str("add"); }
      | DROP         { $$ = make_str("drop"); }
      ;

--- 1032,1038 ----
              { $$ = cat_str(5, make_str("alter group"), $3, $4, make_str("user"), $6); }
          ;

! add_drop: ADD_P        { $$ = make_str("add"); }
      | DROP         { $$ = make_str("drop"); }
      ;

***************
*** 1244,1251 ****
          ;

  alter_table_cmd:
!         ADD opt_column columnDef
! /* ALTER TABLE <relation> ADD [COLUMN] <coldef> */
              { $$ = cat_str(3, make_str("add"), $2, $3); }
  /* ALTER TABLE <relation> ALTER [COLUMN] <colname> {SET DEFAULT <expr>|DROP DEFAULT} */
          | ALTER opt_column ColId alter_column_default
--- 1244,1251 ----
          ;

  alter_table_cmd:
!         ADD_P opt_column columnDef
! /* ALTER TABLE <relation> ADD_P [COLUMN] <coldef> */
              { $$ = cat_str(3, make_str("add"), $2, $3); }
  /* ALTER TABLE <relation> ALTER [COLUMN] <colname> {SET DEFAULT <expr>|DROP DEFAULT} */
          | ALTER opt_column ColId alter_column_default
***************
*** 1268,1275 ****
  /* ALTER TABLE <relation> ALTER [COLUMN] <colname> TYPE <typename> [ USING <expression> ] */
          | ALTER opt_column ColId TYPE_P Typename alter_using
              { $$ = cat_str(6, make_str("alter"), $2, $3, make_str("type"), $5, $6); }
! /* ALTER TABLE <relation> ADD CONSTRAINT ... */
!         | ADD TableConstraint
              { $$ = cat_str(2, make_str("add"), $2); }
  /* ALTER TABLE <relation> DROP CONSTRAINT ... */
          | DROP CONSTRAINT name opt_drop_behavior
--- 1268,1275 ----
  /* ALTER TABLE <relation> ALTER [COLUMN] <colname> TYPE <typename> [ USING <expression> ] */
          | ALTER opt_column ColId TYPE_P Typename alter_using
              { $$ = cat_str(6, make_str("alter"), $2, $3, make_str("type"), $5, $6); }
! /* ALTER TABLE <relation> ADD_P CONSTRAINT ... */
!         | ADD_P TableConstraint
              { $$ = cat_str(2, make_str("add"), $2); }
  /* ALTER TABLE <relation> DROP CONSTRAINT ... */
          | DROP CONSTRAINT name opt_drop_behavior
***************
*** 1385,1391 ****
          | NULL_P opt_as StringConst
              { $$ = cat_str(3, make_str("null"), $2, $3); }
          | CSV        { $$ = make_str("csv"); }
!         | HEADER    { $$ = make_str("header"); }
          | QUOTE opt_as Sconst
              { $$ = cat_str(3, make_str("quote"), $2, $3); }
          | ESCAPE opt_as Sconst
--- 1385,1391 ----
          | NULL_P opt_as StringConst
              { $$ = cat_str(3, make_str("null"), $2, $3); }
          | CSV        { $$ = make_str("csv"); }
!         | HEADER_P    { $$ = make_str("header"); }
          | QUOTE opt_as Sconst
              { $$ = cat_str(3, make_str("quote"), $2, $3); }
          | ESCAPE opt_as Sconst
***************
*** 2847,2853 ****
          { $$ = cat_str(3, make_str("alter domain"), $3, make_str("drop not null")); }
      | ALTER DOMAIN_P any_name SET NOT NULL_P
          { $$ = cat_str(3, make_str("alter domain"), $3, make_str("set not null")); }
!     | ALTER DOMAIN_P any_name ADD TableConstraint
          { $$ = cat_str(4, make_str("alter domain"), $3, make_str("add"), $5); }
      | ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior
          { $$ = cat_str(5, make_str("alter domain"), $3, make_str("drop constraint"), $6, $7); }
--- 2847,2853 ----
          { $$ = cat_str(3, make_str("alter domain"), $3, make_str("drop not null")); }
      | ALTER DOMAIN_P any_name SET NOT NULL_P
          { $$ = cat_str(3, make_str("alter domain"), $3, make_str("set not null")); }
!     | ALTER DOMAIN_P any_name ADD_P TableConstraint
          { $$ = cat_str(4, make_str("alter domain"), $3, make_str("add"), $5); }
      | ALTER DOMAIN_P any_name DROP CONSTRAINT name opt_drop_behavior
          { $$ = cat_str(5, make_str("alter domain"), $3, make_str("drop constraint"), $6, $7); }
***************
*** 6044,6050 ****
          | ABSOLUTE_P            { $$ = make_str("absolute"); }
          | ACCESS            { $$ = make_str("access"); }
          | ACTION            { $$ = make_str("action"); }
!         | ADD                { $$ = make_str("add"); }
          | ADMIN                { $$ = make_str("admin"); }
          | AFTER                { $$ = make_str("after"); }
          | AGGREGATE            { $$ = make_str("aggregate"); }
--- 6044,6050 ----
          | ABSOLUTE_P            { $$ = make_str("absolute"); }
          | ACCESS            { $$ = make_str("access"); }
          | ACTION            { $$ = make_str("action"); }
!         | ADD_P                { $$ = make_str("add"); }
          | ADMIN                { $$ = make_str("admin"); }
          | AFTER                { $$ = make_str("after"); }
          | AGGREGATE            { $$ = make_str("aggregate"); }
***************
*** 6108,6114 ****
          | GLOBAL            { $$ = make_str("global"); }
          | GRANTED            { $$ = make_str("granted"); }
          | HANDLER            { $$ = make_str("handler"); }
!         | HEADER            { $$ = make_str("header"); }
          | HOLD                { $$ = make_str("hold"); }
  /*        | HOUR_P            { $$ = make_str("hour"); }*/
          | IMMEDIATE            { $$ = make_str("immediate"); }
--- 6108,6114 ----
          | GLOBAL            { $$ = make_str("global"); }
          | GRANTED            { $$ = make_str("granted"); }
          | HANDLER            { $$ = make_str("handler"); }
!         | HEADER_P            { $$ = make_str("header"); }
          | HOLD                { $$ = make_str("hold"); }
  /*        | HOUR_P            { $$ = make_str("hour"); }*/
          | IMMEDIATE            { $$ = make_str("immediate"); }

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Disparity in search_path SHOW and SET
Next
From: Tom Lane
Date:
Subject: Re: Disparity in search_path SHOW and SET