Subject: Multiple set attributes in append

From: Glen Niebur <[email-masked]>
Date: Thu, 8 Dec 94 08:29:29 -0600

As promised, here is a diff to the pg_proc.c file which I applied
to allow multiple set valued attributes to be inserted in a
single query.  I have not run the regressions since I changed this,
but have seen no ill effects in my work.  For those who missed the
original question, appends of the form:

append lines ( p1="retrieve (points.all ) where points.id=1, 
	p2="retrieve ( points.all ) where points.id=2" ) \g

fail with the error

	ProcedureDefine: Procedure zyxset already exists with the same arguments.

Below is a diff for build/src/backend/catalog/pg_proc.c

-------8<---------------8<----------8<--------------8<-------------------8<

*** /usr/postgres/build/src/backend/catalog/pg_proc.c   Fri Aug 26 08:28:01 1994
--- pg_proc.c   Tue Nov 29 21:37:11 1994
***************
*** 122,140 ****
  
        typev[parameterCount++] = toid;
  
      }
  
!     tup = SearchSysCacheTuple(PRONAME,
                              (char *) procedureName,
                              (char *) UInt16GetDatum(parameterCount),
                              (char *) typev,
                              (char *) NULL);
  
!     if (HeapTupleIsValid(tup))
!       elog(WARN, "ProcedureDefine: procedure %s already exists with same arguments",
!            procedureName);
  
      if (!namestrcmp((char *)languageName, "postquel"))  {
         /* If this call is defining a set, check if the set is already
          * defined by looking to see whether this call's function text
          * matches a function already in pg_proc.  If so just return the 
--- 122,143 ----
  
        typev[parameterCount++] = toid;
  
      }
  
!     if (namestrcmp((char*)procedureName, GENERICSETNAME)) {
!        tup = SearchSysCacheTuple(PRONAME,
                              (char *) procedureName,
                              (char *) UInt16GetDatum(parameterCount),
                              (char *) typev,
                              (char *) NULL);
  
!           if (HeapTupleIsValid(tup))
!               elog(WARN,
!             "ProcedureDefine: procedure %s already exists with same arguments",
!                    procedureName);
!               }
  
      if (!namestrcmp((char *)languageName, "postquel"))  {
         /* If this call is defining a set, check if the set is already
          * defined by looking to see whether this call's function text
          * matches a function already in pg_proc.  If so just return the 

-------8<---------------8<----------8<--------------8<-------------------8<

Good luck :-)

Glen

Glen Niebur           |
Mayo Clinic           | This space intentionally left blank.
Biomechanics Lab      |
[email-masked] |

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/