agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Glen Niebur <gln@hercules.mayo.edu>
To: postgres@postgres.Berkeley.EDU
Subject: Multiple set attributes in append
Date: Thu, 8 Dec 94 08:29:29 -0600
Message-ID: <9412081429.AA18113@hercules.mayo.edu> (raw)


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      |
gln@hercules.mayo.edu |


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



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: gln@hercules.mayo.edu
  Subject: Re: Multiple set attributes in append
  In-Reply-To: <9412081429.AA18113@hercules.mayo.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox