By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,983 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,983 IT Pros & Developers. It's quick & easy.

Cant view table description

P: 4
Why if I say \d tablename; on tables in my database, does it work for certain tables but on others it gives the following error :

Expand|Select|Wrap|Line Numbers
  1. ERROR: Function pg_catalog.pg_get_indexdef(oid, integer, boolean) does not exist
  2. Unable to identify a function that satisfies the given argument types
  3. You may need to add explicit typecasts
Thanks
Aug 3 '07 #1
Share this Question
Share on Google+
6 Replies


Expert 100+
P: 534
Can you copy and paste here the entire snippet including \d as it entered and the output it generates?
Aug 7 '07 #2

P: 4
If I enter :
\d waybill (or \d waybill;)
The output is :
ERROR: Function pg_catalog.pg_get_indexdef(oid, integer, boolean) does not exist. Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts
Aug 13 '07 #3

Expert 100+
P: 534
Looks like you have a problem; can you run these four commands and post the results they generate?

(the first command uses a lower-case L)
Expand|Select|Wrap|Line Numbers
  1. \l  
  2. select current_database();
  3. \df+  pg_get_indexdef
  4. select version();
  5.  
Aug 13 '07 #4

P: 4
Ok, here it is :
Expand|Select|Wrap|Line Numbers
  1. \l
  2.         List of databases
  3.    Name    |  Owner   | Encoding
  4. -----------+----------+-----------
  5.  db4002    | postgres | SQL_ASCII
  6.  garydb    | postgres | SQL_ASCII
  7.  template0 | postgres | SQL_ASCII
  8.  template1 | postgres | SQL_ASCII
  9. (4 rows)
  10.  
  11. select current_database();
  12.  current_database
  13. ------------------
  14.  db4002
  15. (1 row)
  16.  
  17. \df+  pg_get_indexdef
  18.                                                          List of functions
  19.    Schema   |      Name       | Result data type | Argument data types |  Owner   | Language |   Source code   |    Description
  20. ------------+-----------------+------------------+---------------------+----------+----------+-----------------+-------------------
  21.  pg_catalog | pg_get_indexdef | text             | oid                 | postgres | internal | pg_get_indexdef | index description
  22. (1 row)
  23.  
  24. select version();
  25.                                                         version
  26. -----------------------------------------------------------------------------------------------------------------------
  27.  PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)
  28. (1 row)
  29.  
Aug 13 '07 #5

Expert 100+
P: 534
I checked on the two versions of PostgreSQL I had access to:
Expand|Select|Wrap|Line Numbers
  1. testdb=# select version();
  2.                               version                              
  3. -------------------------------------------------------------------
  4.  PostgreSQL 7.3.10 on sparc-sun-solaris2.8, compiled by GCC 2.95.2
  5. (1 row)
  6.  
  7. testdb=# \df+ pg_get_indexdef
  8.                                                          List of functions
  9.  Result data type |   Schema   |      Name       | Argument data types |  Owner   | Language |   Source code   |    Description    
  10. ------------------+------------+-----------------+---------------------+----------+----------+-----------------+-------------------
  11.  text             | pg_catalog | pg_get_indexdef | oid                 | tomkins  | internal | pg_get_indexdef | index description
  12. (1 row)
  13.  
Expand|Select|Wrap|Line Numbers
  1. postgres=#  select version();
  2.                                          version
  3. ------------------------------------------------------------------------------------------
  4.  PostgreSQL 8.2.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)
  5. (1 row)
  6.  
  7. postgres=#  \df pg_get_indexdef
  8.                             List of functions
  9.    Schema   |      Name       | Result data type |  Argument data types
  10. ------------+-----------------+------------------+-----------------------
  11.  pg_catalog | pg_get_indexdef | text             | oid
  12.  pg_catalog | pg_get_indexdef | text             | oid, integer, boolean
  13. (2 rows)
  14.  
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.
Aug 13 '07 #6

P: 4
Thanks very much for that info.
If I do a 'select version()', it says PostgreSQL 7.3.4
If I do a 'psql --version', it says PostgreSQL 8.0.3
so thats a bit intersting.
I'll see what I can do, thanks.
Aug 15 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.