0006-Subject-PATCH-6-8-Print-publication-WHERE-condition-.patch
application/octet-stream
Filename: 0006-Subject-PATCH-6-8-Print-publication-WHERE-condition-.patch
Type: application/octet-stream
Part: 5
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0006
Subject: Subject: [PATCH 6/8] Print publication WHERE condition in psql
| File | + | − |
|---|---|---|
| src/bin/psql/describe.c | 6 | 1 |
From 1371a7d12083dcb6058039f1466c4c6144062ab7 Mon Sep 17 00:00:00 2001
From: Onder Kalaci <onderkalaci@gmail.com>
Date: Tue, 8 Dec 2020 16:46:56 +0300
Subject: [PATCH 6/7] Subject: [PATCH 6/8] Print publication WHERE condition in
psql
---
src/bin/psql/describe.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 14150d05a9..60ab245738 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -5937,7 +5937,8 @@ describePublications(const char *pattern)
if (!puballtables)
{
printfPQExpBuffer(&buf,
- "SELECT n.nspname, c.relname\n"
+ "SELECT n.nspname, c.relname,\n"
+ " pg_get_expr(pr.prqual, c.oid)\n"
"FROM pg_catalog.pg_class c,\n"
" pg_catalog.pg_namespace n,\n"
" pg_catalog.pg_publication_rel pr\n"
@@ -5967,6 +5968,10 @@ describePublications(const char *pattern)
PQgetvalue(tabres, j, 0),
PQgetvalue(tabres, j, 1));
+ if (!PQgetisnull(tabres, j, 2))
+ appendPQExpBuffer(&buf, " WHERE %s",
+ PQgetvalue(tabres, j, 2));
+
printTableAddFooter(&cont, buf.data);
}
PQclear(tabres);
--
2.19.0