Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-5212

install_iplike.sh needs explicit DROP FUNCTION if PL/PGSQL sproc already exists / PostgreSQL 9.1 / Ubuntu 11.10+ / Fedora 16+

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 14.0.0
    • Component/s: Installation
    • Security Level: Default (Default Security Scheme)
    • Labels:
    • Environment:

      Description

      On a system where the fallback PL/PGSQL version of IPLIKE already exists in the opennms database, try running the C-language iplike installer script:

      opennms@stanford:~$ sudo /usr/sbin/install_iplike.sh
      ERROR: cannot change name of input parameter "i_ipaddress"
      HINT: Use DROP FUNCTION first.

      Previous to the use of "CREATE OR REPLACE FUNCTION" in this script seemed to cause PostgreSQL to "do the right thing", i.e. drop the PL/PGSQL version of the sproc and replace it with the C version in a single step. My best guess at what's up here is that PostgreSQL 9.1 is stricter than its forbears, perhaps disallowing CREATE OR REPLACE when the old and new sprocs' signatures are not 100% identical down to parameter names.

      Workaround: explicitly drop the sproc and then re-run the install_iplike script:

      opennms@stanford:~$ psql -U postgres -h localhost opennms -c "DROP FUNCTION iplike(text,text);"
      DROP FUNCTION

      opennms@stanford:~$ sudo /usr/sbin/install_iplike.sh
      CREATE FUNCTION

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              jeffg Jeff Gehlbach
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: