Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-12-01 Thread Bruce Momjian

Patch applied.  Thanks.

The CHECK part of this patch was already applied to 7.4.

---



Christopher Kings-Lynne wrote:
> Resubmission of patch (for 7.4).
> 
> I fixed the problems I was having what I chatted to you Bruce, I've 
> tested it well and it shouldn't be a problem to apply for 7.4.  It looks 
> really nice with the pretty print stuff!
> 
> Chris
> 
>  Original Message 
> Subject: [PATCHES] Make psql use all pretty print options
> Date: Mon, 29 Sep 2003 12:31:18 +0800 (WST)
> From: Christopher Kings-Lynne <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> Hi,
> 
> This patch finishes off the work that I did with making view
> definitions use pretty printing.
> 
> It does:
> 
> * Pretty check constraints
> * Pretty index predicates
> * Pretty rule definitions
> * Uppercases PRIMARY KEY and UNIQUE to be consistent with CHECK and
> FOREIGN KEY
> * View rules are improved to match table rules:
> 
>  View "public.v"
>Column  |  Type   | Modifiers
> --+-+---
>   ?column? | integer |
> View definition:
>   SELECT 1;
> Rules:
>   r1 AS
>  ON INSERT TO v DO INSTEAD NOTHING
>   r2 AS
>  ON INSERT TO v DO INSTEAD NOTHING
> 
> Chris
> 
> 
> 

> Index: describe.c
> ===
> RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/describe.c,v
> retrieving revision 1.85
> diff -c -r1.85 describe.c
> *** describe.c7 Sep 2003 03:43:53 -   1.85
> --- describe.c29 Sep 2003 04:24:56 -
> ***
> *** 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> --- 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid, true)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> ***
> *** 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("primary key, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("unique, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> --- 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("PRIMARY KEY, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("UNIQUE, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> ***
> *** 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate %s", indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> --- 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate (%s)", 
> indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> ***
> *** 911,917 
>   if (tableinfo.hasrules)
>   {
>   printfPQExpBuffer(&buf,
> !   "SELECT r.rulename\n"
> "FROM pg_catalog.pg_rewrite 
> r\n"
>   

Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-11-30 Thread Bruce Momjian

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---


Christopher Kings-Lynne wrote:
> Resubmission of patch (for 7.4).
> 
> I fixed the problems I was having what I chatted to you Bruce, I've 
> tested it well and it shouldn't be a problem to apply for 7.4.  It looks 
> really nice with the pretty print stuff!
> 
> Chris
> 
>  Original Message 
> Subject: [PATCHES] Make psql use all pretty print options
> Date: Mon, 29 Sep 2003 12:31:18 +0800 (WST)
> From: Christopher Kings-Lynne <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> Hi,
> 
> This patch finishes off the work that I did with making view
> definitions use pretty printing.
> 
> It does:
> 
> * Pretty check constraints
> * Pretty index predicates
> * Pretty rule definitions
> * Uppercases PRIMARY KEY and UNIQUE to be consistent with CHECK and
> FOREIGN KEY
> * View rules are improved to match table rules:
> 
>  View "public.v"
>Column  |  Type   | Modifiers
> --+-+---
>   ?column? | integer |
> View definition:
>   SELECT 1;
> Rules:
>   r1 AS
>  ON INSERT TO v DO INSTEAD NOTHING
>   r2 AS
>  ON INSERT TO v DO INSTEAD NOTHING
> 
> Chris
> 
> 
> 

> Index: describe.c
> ===
> RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/describe.c,v
> retrieving revision 1.85
> diff -c -r1.85 describe.c
> *** describe.c7 Sep 2003 03:43:53 -   1.85
> --- describe.c29 Sep 2003 04:24:56 -
> ***
> *** 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> --- 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid, true)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> ***
> *** 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("primary key, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("unique, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> --- 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("PRIMARY KEY, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("UNIQUE, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> ***
> *** 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate %s", indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> --- 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate (%s)", 
> indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> ***
> *** 911,917 
>   if (tableinfo.hasrules)
>   {
>   printfPQExpBuffer(&buf,
> !   "SELECT r.rulename\n"
>  

Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-14 Thread Peter Eisentraut
Tom Lane writes:

> Doing that would require making this one string change:
>
> ! printfPQExpBuffer(&buf, _("\"%s\" CHECK %s"),
> becomes
> ! printfPQExpBuffer(&buf, _("\"%s\" %s"),
>
> but ISTM the latter string doesn't really need any translation and so
> it wouldn't be much of a problem.

The quotation marks need "translation".  But indeed it wouldn't be "much"
of a problem.  I agree that this is a desirable bug fix.

-- 
Peter Eisentraut   [EMAIL PROTECTED]


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-14 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> Resubmission of patch (for 7.4).

While I agree with the objection that we shouldn't break the strings
freeze for this, I do think it might be a good idea to apply the change
that prints CHECK constraints using pg_get_constraintdef() rather than
simply looking at pg_constraint.consrc.  This is arguably a bug fix,
not a pretty printing improvement, because consrc doesn't track column
renamings (and probably other changes).

Doing that would require making this one string change:

! printfPQExpBuffer(&buf, _("\"%s\" CHECK %s"),
becomes
! printfPQExpBuffer(&buf, _("\"%s\" %s"),

but ISTM the latter string doesn't really need any translation and so
it wouldn't be much of a problem.

Comments?

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-10 Thread Bruce Momjian

This has been saved for the 7.5 release:

http:/momjian.postgresql.org/cgi-bin/pgpatches2

---

Christopher Kings-Lynne wrote:
> Resubmission of patch (for 7.4).
> 
> I fixed the problems I was having what I chatted to you Bruce, I've 
> tested it well and it shouldn't be a problem to apply for 7.4.  It looks 
> really nice with the pretty print stuff!
> 
> Chris
> 
>  Original Message 
> Subject: [PATCHES] Make psql use all pretty print options
> Date: Mon, 29 Sep 2003 12:31:18 +0800 (WST)
> From: Christopher Kings-Lynne <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> Hi,
> 
> This patch finishes off the work that I did with making view
> definitions use pretty printing.
> 
> It does:
> 
> * Pretty check constraints
> * Pretty index predicates
> * Pretty rule definitions
> * Uppercases PRIMARY KEY and UNIQUE to be consistent with CHECK and
> FOREIGN KEY
> * View rules are improved to match table rules:
> 
>  View "public.v"
>Column  |  Type   | Modifiers
> --+-+---
>   ?column? | integer |
> View definition:
>   SELECT 1;
> Rules:
>   r1 AS
>  ON INSERT TO v DO INSTEAD NOTHING
>   r2 AS
>  ON INSERT TO v DO INSTEAD NOTHING
> 
> Chris
> 
> 
> 

> Index: describe.c
> ===
> RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/describe.c,v
> retrieving revision 1.85
> diff -c -r1.85 describe.c
> *** describe.c7 Sep 2003 03:43:53 -   1.85
> --- describe.c29 Sep 2003 04:24:56 -
> ***
> *** 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> --- 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid, true)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> ***
> *** 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("primary key, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("unique, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> --- 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("PRIMARY KEY, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("UNIQUE, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> ***
> *** 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate %s", indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> --- 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate (%s)", 
> indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> ***
> *** 911,917 
>   if (tableinfo.hasrules)
>   {
>   printfPQExpBuffer(&buf,
> !   "SELECT r.rulename\n"
> "FROM pg_catalog.pg_rewrite 
>

Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-10 Thread Bruce Momjian
Christopher Kings-Lynne wrote:
> > It looks like the patch changes translated strings which isn't supposed to
> > happen. It can of course still be accepted, that's not my call.
> 
> Yes, actually it does now that I look at it.  However, I submitted this 
> patch weeks ago.  If it's not accepted for the time being due to freeze, 
> then that's fine - but it should at least be added for 7.5.

Yes, it should be added for 7.5.  Even when it was originally submitted,
it was past the time for accepting new 7.4 features, so I always assumed
it was for 7.5.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-10 Thread Alvaro Herrera
On Fri, Oct 10, 2003 at 12:42:50PM +0800, Christopher Kings-Lynne wrote:

> OK, for reviewers.  Note the index predicate and the check constraint in 
> particular.

It seems to have the nice property of allowing output to be
copy-n-pasted without further modification.

-- 
Alvaro Herrera ()
"The Gord often wonders why people threaten never to come back after they've
been told never to return" (www.actsofgord.com)

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-09 Thread Christopher Kings-Lynne
Uh, I can't apply this to 7.4 unless you can get others to agree it
should be added.  Sorry.
OK, for reviewers.  Note the index predicate and the check constraint in 
particular.

With patch:

test=# \d example
  Table "public.example"
 Column |  Type   |   Modifiers
+-+
 a  | integer | not null default nextval('public.example_a_seq'::text)
 b  | integer |
 c  | integer |
 d  | boolean |
Indexes:
"example_pkey" PRIMARY KEY, btree (a)
"example_b_key" UNIQUE, btree (b)
"example_idx" btree (abs(a)) WHERE c > 11
Check constraints:
"example_d" CHECK (d)
Foreign-key constraints:
"$1" FOREIGN KEY (c) REFERENCES parent(a)
Rules:
example_rule AS
ON INSERT TO example DO INSTEAD NOTHING
Without patch:

test=# \d example
  Table "public.example"
 Column |  Type   |   Modifiers
+-+
 a  | integer | not null default nextval('public.example_a_seq'::text)
 b  | integer |
 c  | integer |
 d  | boolean |
Indexes:
"example_pkey" primary key, btree (a)
"example_b_key" unique, btree (b)
"example_idx" btree (abs(a)) WHERE (c > 11)
Check constraints:
"example_d" CHECK d
Foreign-key constraints:
"$1" FOREIGN KEY (c) REFERENCES parent(a)
Rules:
example_rule AS ON INSERT TO example DO INSTEAD NOTHING


---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-09 Thread Christopher Kings-Lynne
It looks like the patch changes translated strings which isn't supposed to
happen. It can of course still be accepted, that's not my call.
Yes, actually it does now that I look at it.  However, I submitted this 
patch weeks ago.  If it's not accepted for the time being due to freeze, 
then that's fine - but it should at least be added for 7.5.

ps. Unified diffs (-u) are much nicer then the default format.
It was submitted in diff -c, the recommended pgsql patch format.

Chris



---(end of broadcast)---
TIP 6: Have you searched our list archives?
  http://archives.postgresql.org


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-09 Thread Dennis Bjorklund
On Thu, 9 Oct 2003, Bruce Momjian wrote:

> Uh, I can't apply this to 7.4 unless you can get others to agree it
> should be added.  Sorry.

It looks like the patch changes translated strings which isn't supposed to
happen. It can of course still be accepted, that's not my call.

ps. Unified diffs (-u) are much nicer then the default format.

-- 
/Dennis


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [Fwd: [PATCHES] Make psql use all pretty print options]

2003-10-09 Thread Bruce Momjian

Uh, I can't apply this to 7.4 unless you can get others to agree it
should be added.  Sorry.

I am including the patch in this email in case people want to review it.

---

Christopher Kings-Lynne wrote:
> Resubmission of patch (for 7.4).
> 
> I fixed the problems I was having what I chatted to you Bruce, I've 
> tested it well and it shouldn't be a problem to apply for 7.4.  It looks 
> really nice with the pretty print stuff!
> 
> Chris
> 
>  Original Message 
> Subject: [PATCHES] Make psql use all pretty print options
> Date: Mon, 29 Sep 2003 12:31:18 +0800 (WST)
> From: Christopher Kings-Lynne <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 
> Hi,
> 
> This patch finishes off the work that I did with making view
> definitions use pretty printing.
> 
> It does:
> 
> * Pretty check constraints
> * Pretty index predicates
> * Pretty rule definitions
> * Uppercases PRIMARY KEY and UNIQUE to be consistent with CHECK and
> FOREIGN KEY
> * View rules are improved to match table rules:
> 
>  View "public.v"
>Column  |  Type   | Modifiers
> --+-+---
>   ?column? | integer |
> View definition:
>   SELECT 1;
> Rules:
>   r1 AS
>  ON INSERT TO v DO INSTEAD NOTHING
>   r2 AS
>  ON INSERT TO v DO INSTEAD NOTHING
> 
> Chris
> 
> 
> 

> Index: describe.c
> ===
> RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/describe.c,v
> retrieving revision 1.85
> diff -c -r1.85 describe.c
> *** describe.c7 Sep 2003 03:43:53 -   1.85
> --- describe.c29 Sep 2003 04:24:56 -
> ***
> *** 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> --- 857,863 
>   
>   printfPQExpBuffer(&buf,
> "SELECT i.indisunique, i.indisprimary, a.amname, c2.relname,\n"
> !   "  pg_catalog.pg_get_expr(i.indpred, 
> i.indrelid, true)\n"
> "FROM pg_catalog.pg_index i, 
> pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_am a\n"
> "WHERE i.indexrelid = c.oid AND 
> c.oid = '%s' AND c.relam = a.oid\n"
> "AND i.indrelid = c2.oid",
> ***
> *** 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("primary key, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("unique, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> --- 880,888 
>   char   *indpred = PQgetvalue(result, 0, 4);
>   
>   if (strcmp(indisprimary, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("PRIMARY KEY, "));
>   else if (strcmp(indisunique, "t") == 0)
> ! printfPQExpBuffer(&tmpbuf, _("UNIQUE, "));
>   else
>   resetPQExpBuffer(&tmpbuf);
>   appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
> ***
> *** 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate %s", indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> --- 892,898 
> schemaname, indtable);
>   
>   if (strlen(indpred))
> ! appendPQExpBuffer(&tmpbuf, ", predicate (%s)", 
> indpred);
>   
>   footers = xmalloczero(2 * sizeof(*footers));
>   footers[0] = xstrdup(tmpbuf.data);
> ***
> *** 911,917 
>   if (tableinfo.hasrules)
>   {
>   printfPQExpBuffer(&buf,
> !   "SELECT r.rulename\n"
>