Re: function "XXX" already exists with same argument types

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: function "XXX" already exists with same argument types
Date: 2011-10-05 15:24:57
Message-ID: 5685D224-52EA-4046-B431-E32648A20F70@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 added to the new database when it's created.

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2011-10-05 15:27:11 Re: function "XXX" already exists with same argument types
Previous Message Tom Lane 2011-10-05 15:23:15 Re: BUG #6240: About - postgreswdinit.sql