Re: function "XXX" already exists with same argument types - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: function "XXX" already exists with same argument types
Date
Msg-id 5685D224-52EA-4046-B431-E32648A20F70@seespotcode.net
Whole thread Raw
In response to function "XXX" already exists with same argument types  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: function "XXX" already exists with same argument types  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
On Oct 5, 2011, at 11:21, Alexander Farber wrote:

> Hello,
>
> I use PostgreSQL 8.4 under CentOS 5.7:
>
> #  rpm -qa | grep post
> compat-postgresql-libs-4-1PGDG.rhel5
> postgresql-8.4.9-1PGDG.rhel5
> postgresql-server-8.4.9-1PGDG.rhel5
> compat-postgresql-libs-4-1PGDG.rhel5
> postgresql-libs-8.4.9-1PGDG.rhel5
> postgresql-devel-8.4.9-1PGDG.rhel5
>
> And perform nightly backups with this cronjob:
>
> 1   1    *   *   *    pg_dump $PGDATABASE | gzip -c >
> $HOME/backups/pref-`date +\%F`.sql.gz
>
> I also restored them on the same and another
> machines (dev. VMs) often and w/o problems.
>
> Now I'm trying to migrate to another machine
> and CentOS 6 and suddenly emits the warnings:
>
> # rpm -qa|grep post
> postgresql-libs-8.4.7-2.el6.x86_64
> postgresql-devel-8.4.7-2.el6.x86_64
> postgresql-8.4.7-2.el6.x86_64
> postgresql-docs-8.4.7-2.el6.x86_64
> postgresql-server-8.4.7-2.el6.x86_64
>
> pref# \i pref-2011-10-05-a.sql
> SET
> SET
> SET
> SET
> SET
> SET
> psql:pref-2011-10-05-a.sql:16: ERROR:  language "plpgsql" already exists
> ALTER LANGUAGE
> SET
> CREATE DOMAIN
> ALTER DOMAIN
> ............
> CREATE FUNCTION
> ALTER FUNCTION
> CREATE FUNCTION
> ALTER FUNCTION
> psql:pref-2011-10-05-a.sql:195: ERROR:  function "pref_update_catch"
> already exists with same argument types
> ALTER FUNCTION
> psql:pref-2011-10-05-a.sql:236: ERROR:  function "pref_update_game"
> already exists with same argument types
> ALTER FUNCTION
> psql:pref-2011-10-05-a.sql:256: ERROR:  function "pref_update_hand"
> already exists with same argument types
> ALTER FUNCTION
> psql:pref-2011-10-05-a.sql:288: ERROR:  function "pref_update_luck"
> already exists with same argument types
> ALTER FUNCTION
> CREATE FUNCTION
> ALTER FUNCTION
> psql:pref-2011-10-05-a.sql:339: ERROR:  function "pref_update_match"
> already exists with same argument types
> ALTER FUNCTION
>
> The 1st waring is ok, as I've run "create language plpgsql" before.
>
> But why do I get the function warings?

Likely someone mistakenly added the functions to template1 of the machine you're restoring onto and they're getting
addedto the new database when it's created. 

Michael Glaesemann
grzm seespotcode net




pgsql-general by date:

Previous
From: pasman pasmański
Date:
Subject: Re: Restoring 2 Tables From All Databases Backup
Next
From: Alexander Farber
Date:
Subject: Re: function "XXX" already exists with same argument types