Quick fix so \d indexname works again

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Quick fix so \d indexname works again
Date: 2001-11-05 20:24:55
Message-ID: 200111052024.PAA30607@smtp10.atl.mindspring.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't think this is worthy of a full patch, but could someone
back off of the new pg_get_expr function in
src/bin/psql/describe.c? It does not seem to work, producing
this message when you try to "\d indexname" in psql:

ERROR: Function 'pg_get_expr(text, oid)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts

A quick fix is to remove the pg_get_expr function and replace
it with a simple i.indpred. Either that, or get the pg_get_expr
to work properly (which is beyond me at the moment :)

*** ./src/bin/psql/describe.c.orig Mon Nov 5 15:11:02 2001
- --- ./src/bin/psql/describe.c Mon Nov 5 15:11:40 2001
***************
*** 654,660 ****
PGresult *result;

sprintf(buf, "SELECT i.indisunique, i.indisprimary, a.amname,\n"
! " pg_get_expr(i.indpred, i.indrelid) as indpred\n"
"FROM pg_index i, pg_class c, pg_am a\n"
"WHERE i.indexrelid = c.oid AND c.relname = '%s' AND c.relam = a.oid",
name);
- --- 654,660 ----
PGresult *result;

sprintf(buf, "SELECT i.indisunique, i.indisprimary, a.amname,\n"
! " i.indpred\n"
"FROM pg_index i, pg_class c, pg_am a\n"
"WHERE i.indexrelid = c.oid AND c.relname = '%s' AND c.relam = a.oid",
name);

Thanks,
Greg Sabino Mullane
greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200111051523

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iQA/AwUBO+b2VLybkGcUlkrIEQIdIQCfZxoEJdtbdLVte+WXZeSii+hJweMAoKue
ixzMXJskieqIuLwOWA5ToWzP
=Jkol
-----END PGP SIGNATURE-----

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-11-05 22:31:18 Re: Quick fix so \d indexname works again
Previous Message Bruce Momjian 2001-11-05 16:11:21 Re: Efficient slicing/substring of TOAST values (for comment)