I checked on the two versions of PostgreSQL I had access to:
-
testdb=# select version();
-
version
-
-------------------------------------------------------------------
-
PostgreSQL 7.3.10 on sparc-sun-solaris2.8, compiled by GCC 2.95.2
-
(1 row)
-
-
testdb=# \df+ pg_get_indexdef
-
List of functions
-
Result data type | Schema | Name | Argument data types | Owner | Language | Source code | Description
-
------------------+------------+-----------------+---------------------+----------+----------+-----------------+-------------------
-
text | pg_catalog | pg_get_indexdef | oid | tomkins | internal | pg_get_indexdef | index description
-
(1 row)
-
-
postgres=# select version();
-
version
-
------------------------------------------------------------------------------------------
-
PostgreSQL 8.2.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)
-
(1 row)
-
-
postgres=# \df pg_get_indexdef
-
List of functions
-
Schema | Name | Result data type | Argument data types
-
------------+-----------------+------------------+-----------------------
-
pg_catalog | pg_get_indexdef | text | oid
-
pg_catalog | pg_get_indexdef | text | oid, integer, boolean
-
(2 rows)
-
So, the version 7.3.10, which is comparable to yours has only one function pg_get_indexdef, while version 8.2.3 has also the overloaded version, which takes three arguments.
This is exactly the implementation that were missing in your db, according to the error message you got:
ERROR: Function pg_catalog.pg_get_indexdef(oid, integer, boolean) does not exist.
The question is why there's a call to the function that should not be there?
I would take a good look at how this server was build, installed or configured. Could it be there's some version mismatch between software components?
But first check on your PATH variable and try to run command
which psql
and
psql --version
to make sure that executable you are calling is from the correct installation. I'd think there's got to be a compatibility check, but you never know. It is not unheard of to have more than one version of the database server on the machine, so your env. variables may play a critical role here.