Thread: pgsql-server/src/backend catalog/pg_proc.c nod ...

pgsql-server/src/backend catalog/pg_proc.c nod ...

From
momjian@postgresql.org (Bruce Momjian - CVS)
Date:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    momjian@postgresql.org    02/08/04 16:00:15

Modified files:
    src/backend/catalog: pg_proc.c
    src/backend/nodes: equalfuncs.c

Log message:
    Fix compile failures for FRS composite tyhpe patch until Joe can fix it.


Re: pgsql-server/src/backend catalog/pg_proc.c nod ...

From
Joe Conway
Date:
Bruce Momjian - CVS wrote:
> CVSROOT:    /cvsroot
> Module name:    pgsql-server
> Changes by:    momjian@postgresql.org    02/08/04 16:00:15
>
> Modified files:
>     src/backend/catalog: pg_proc.c
>     src/backend/nodes: equalfuncs.c
>
> Log message:
>     Fix compile failures for FRS composite tyhpe patch until Joe can fix it.

The pg_proc problem was my fault -- sorry about that. Bruce's fix was
correct.

The equalfuncs.c problem was due to a bad merge -- the hunk got applied
to RangeVar instead of RangeFunction.

Attached is a patch to fix both files. I cannot confirm it yet however
because of unrelated compile issues. I've worked around these two
(workarounds excluded from the patch):

- make clean fails due to not finding contrib/earthdistance
- make all fails due to undefined reference to `XLogDir'

I'm still getting:
utils/SUBSYS.o: In function `timestamptz_date':
/opt/src/pgsql/src/backend/utils/adt/date.c:410: undefined reference to
`backend_pid'
collect2: ld returned 1 exit status
make[2]: *** [postgres] Error 1

which is odd because I can't find a reference to backend_pid at all in
date.c. Any  pointers to work around this one?

Joe




Index: src/backend/catalog/pg_proc.c
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/backend/catalog/pg_proc.c,v
retrieving revision 1.84
diff -c -r1.84 pg_proc.c
*** src/backend/catalog/pg_proc.c    4 Aug 2002 20:00:15 -0000    1.84
--- src/backend/catalog/pg_proc.c    4 Aug 2002 21:38:25 -0000
***************
*** 318,324 ****
   * type he claims.
   */
  static void
! checkretval(Oid rettype, char fn_typtype /* XXX FIX ME */, List *queryTreeList)
  {
      Query       *parse;
      int            cmd;
--- 318,324 ----
   * type he claims.
   */
  static void
! checkretval(Oid rettype, char fn_typtype, List *queryTreeList)
  {
      Query       *parse;
      int            cmd;
Index: src/backend/nodes/equalfuncs.c
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/backend/nodes/equalfuncs.c,v
retrieving revision 1.148
diff -c -r1.148 equalfuncs.c
*** src/backend/nodes/equalfuncs.c    4 Aug 2002 20:00:15 -0000    1.148
--- src/backend/nodes/equalfuncs.c    4 Aug 2002 21:44:03 -0000
***************
*** 1607,1616 ****
          return false;
      if (!equal(a->alias, b->alias))
          return false;
! /* FIX ME XXX
!     if (!equal(a->coldeflist, b->coldeflist))
!         return false;
! */
      return true;
  }

--- 1607,1613 ----
          return false;
      if (!equal(a->alias, b->alias))
          return false;
!
      return true;
  }

***************
*** 1631,1636 ****
--- 1628,1635 ----
      if (!equal(a->funccallnode, b->funccallnode))
          return false;
      if (!equal(a->alias, b->alias))
+         return false;
+     if (!equal(a->coldeflist, b->coldeflist))
          return false;

      return true;

Re: pgsql-server/src/backend catalog/pg_proc.c nod ...

From
Joe Conway
Date:
Joe Conway wrote:
> I'm still getting:
> utils/SUBSYS.o: In function `timestamptz_date':
> /opt/src/pgsql/src/backend/utils/adt/date.c:410: undefined reference to
> `backend_pid'
> collect2: ld returned 1 exit status
> make[2]: *** [postgres] Error 1
>
> which is odd because I can't find a reference to backend_pid at all in
> date.c. Any  pointers to work around this one?
>

OK - found the issue. pg_proc.h still had a reference to backend_pid
instead of pg_backend_pid. Here's the fix (attached).

Joe

Index: src/include/catalog/pg_proc.h
===================================================================
RCS file: /opt/src/cvs/pgsql-server/src/include/catalog/pg_proc.h,v
retrieving revision 1.250
diff -c -r1.250 pg_proc.h
*** src/include/catalog/pg_proc.h    4 Aug 2002 20:01:33 -0000    1.250
--- src/include/catalog/pg_proc.h    4 Aug 2002 22:22:57 -0000
***************
*** 2703,2709 ****
  DESCR("Statistics: Number of blocks found in cache");
  DATA(insert OID = 1936 (  pg_stat_get_backend_idset        PGNSP PGUID 12 f f t t s 0 23 ""
pg_stat_get_backend_idset- _null_ )); 
  DESCR("Statistics: Currently active backend IDs");
! DATA(insert OID = 2026 (  pg_backend_pid                PGNSP PGUID 12 f f t f s 0 23 ""    backend_pid - _null_ ));
  DESCR("Statistics: Current backend ID");
  DATA(insert OID = 1937 (  pg_stat_get_backend_pid        PGNSP PGUID 12 f f t f s 1 23 "23"  pg_stat_get_backend_pid
-_null_ )); 
  DESCR("Statistics: PID of backend");
--- 2703,2709 ----
  DESCR("Statistics: Number of blocks found in cache");
  DATA(insert OID = 1936 (  pg_stat_get_backend_idset        PGNSP PGUID 12 f f t t s 0 23 ""
pg_stat_get_backend_idset- _null_ )); 
  DESCR("Statistics: Currently active backend IDs");
! DATA(insert OID = 2026 (  pg_backend_pid                PGNSP PGUID 12 f f t f s 0 23 ""    pg_backend_pid - _null_
));
  DESCR("Statistics: Current backend ID");
  DATA(insert OID = 1937 (  pg_stat_get_backend_pid        PGNSP PGUID 12 f f t f s 1 23 "23"  pg_stat_get_backend_pid
-_null_ )); 
  DESCR("Statistics: PID of backend");

Re: pgsql-server/src/backend catalog/pg_proc.c nod ...

From
Tom Lane
Date:
Joe Conway <mail@joeconway.com> writes:
> OK - found the issue. pg_proc.h still had a reference to backend_pid
> instead of pg_backend_pid. Here's the fix (attached).

Done.

            regards, tom lane

Re: pgsql-server/src/backend catalog/pg_proc.c nod ...

From
Tom Lane
Date:
Joe Conway <mail@joeconway.com> writes:
> The pg_proc problem was my fault -- sorry about that. Bruce's fix was
> correct.
> The equalfuncs.c problem was due to a bad merge -- the hunk got applied
> to RangeVar instead of RangeFunction.

> Attached is a patch to fix both files.

Patch applied.

> I cannot confirm it yet however
> because of unrelated compile issues. I've worked around these two
> (workarounds excluded from the patch):

> - make clean fails due to not finding contrib/earthdistance

contrib/earthdistance is still there according to my copy of CVS.
I believe that Marc split out that directory into a separate CVS module;
if you're using CVSup then this may suggest a problem with your cvsup
config?

> - make all fails due to undefined reference to `XLogDir'

This is breakage in Thomas' recent XLOG patch.  I am strongly tempted
to revert that patch, given that neither Bruce nor I like it, but will
refrain for fear of getting Thomas ticked off at me ...

            regards, tom lane

Re: pgsql-server/src/backend catalog/pg_proc.c nod ...

From
Bruce Momjian
Date:
Thanks, Joe.  Looks like Tom cleaned that up.  Sorry about the
backend_pid mistake.  I missed that part because it was off the edge of
my screen and I was running out the door.

I do try to do this methodically, but sometimes the _delay_ of waiting
for a quiet time causes other problems (merge conflicts).

---------------------------------------------------------------------------

Joe Conway wrote:
> Bruce Momjian - CVS wrote:
> > CVSROOT:    /cvsroot
> > Module name:    pgsql-server
> > Changes by:    momjian@postgresql.org    02/08/04 16:00:15
> >
> > Modified files:
> >     src/backend/catalog: pg_proc.c
> >     src/backend/nodes: equalfuncs.c
> >
> > Log message:
> >     Fix compile failures for FRS composite tyhpe patch until Joe can fix it.
>
> The pg_proc problem was my fault -- sorry about that. Bruce's fix was
> correct.
>
> The equalfuncs.c problem was due to a bad merge -- the hunk got applied
> to RangeVar instead of RangeFunction.
>
> Attached is a patch to fix both files. I cannot confirm it yet however
> because of unrelated compile issues. I've worked around these two
> (workarounds excluded from the patch):
>
> - make clean fails due to not finding contrib/earthdistance
> - make all fails due to undefined reference to `XLogDir'
>
> I'm still getting:
> utils/SUBSYS.o: In function `timestamptz_date':
> /opt/src/pgsql/src/backend/utils/adt/date.c:410: undefined reference to
> `backend_pid'
> collect2: ld returned 1 exit status
> make[2]: *** [postgres] Error 1
>
> which is odd because I can't find a reference to backend_pid at all in
> date.c. Any  pointers to work around this one?
>
> Joe
>
>
>
>

> Index: src/backend/catalog/pg_proc.c
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/src/backend/catalog/pg_proc.c,v
> retrieving revision 1.84
> diff -c -r1.84 pg_proc.c
> *** src/backend/catalog/pg_proc.c    4 Aug 2002 20:00:15 -0000    1.84
> --- src/backend/catalog/pg_proc.c    4 Aug 2002 21:38:25 -0000
> ***************
> *** 318,324 ****
>    * type he claims.
>    */
>   static void
> ! checkretval(Oid rettype, char fn_typtype /* XXX FIX ME */, List *queryTreeList)
>   {
>       Query       *parse;
>       int            cmd;
> --- 318,324 ----
>    * type he claims.
>    */
>   static void
> ! checkretval(Oid rettype, char fn_typtype, List *queryTreeList)
>   {
>       Query       *parse;
>       int            cmd;
> Index: src/backend/nodes/equalfuncs.c
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/src/backend/nodes/equalfuncs.c,v
> retrieving revision 1.148
> diff -c -r1.148 equalfuncs.c
> *** src/backend/nodes/equalfuncs.c    4 Aug 2002 20:00:15 -0000    1.148
> --- src/backend/nodes/equalfuncs.c    4 Aug 2002 21:44:03 -0000
> ***************
> *** 1607,1616 ****
>           return false;
>       if (!equal(a->alias, b->alias))
>           return false;
> ! /* FIX ME XXX
> !     if (!equal(a->coldeflist, b->coldeflist))
> !         return false;
> ! */
>       return true;
>   }
>
> --- 1607,1613 ----
>           return false;
>       if (!equal(a->alias, b->alias))
>           return false;
> !
>       return true;
>   }
>
> ***************
> *** 1631,1636 ****
> --- 1628,1635 ----
>       if (!equal(a->funccallnode, b->funccallnode))
>           return false;
>       if (!equal(a->alias, b->alias))
> +         return false;
> +     if (!equal(a->coldeflist, b->coldeflist))
>           return false;
>
>       return true;

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026