Skip to content

Commit 610fffa

Browse files
author
Commitfest Bot
committed
[CF 5699] v2 - Adding error messages to a few slash commands
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5699 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAKiP-K-QgovuxqunKJHHmL+i7px2Jc30gX8-rvAj7ug9E1f7zw@mail.gmail.com Author(s): Abhishek Chanda
2 parents 88f0fda + 3b086b4 commit 610fffa

File tree

1 file changed

+1
-80
lines changed

1 file changed

+1
-80
lines changed

src/bin/psql/describe.c

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,20 +1520,6 @@ describeTableDetails(const char *pattern, bool verbose, bool showSystem)
15201520
if (!res)
15211521
return false;
15221522

1523-
if (PQntuples(res) == 0)
1524-
{
1525-
if (!pset.quiet)
1526-
{
1527-
if (pattern)
1528-
pg_log_error("Did not find any relation named \"%s\".",
1529-
pattern);
1530-
else
1531-
pg_log_error("Did not find any relations.");
1532-
}
1533-
PQclear(res);
1534-
return false;
1535-
}
1536-
15371523
for (i = 0; i < PQntuples(res); i++)
15381524
{
15391525
const char *oid;
@@ -1720,14 +1706,6 @@ describeOneTableDetails(const char *schemaname,
17201706
if (!res)
17211707
goto error_return;
17221708

1723-
/* Did we get anything? */
1724-
if (PQntuples(res) == 0)
1725-
{
1726-
if (!pset.quiet)
1727-
pg_log_error("Did not find any relation with OID %s.", oid);
1728-
goto error_return;
1729-
}
1730-
17311709
tableinfo.checks = atoi(PQgetvalue(res, 0, 0));
17321710
tableinfo.relkind = *(PQgetvalue(res, 0, 1));
17331711
tableinfo.hasindex = strcmp(PQgetvalue(res, 0, 2), "t") == 0;
@@ -3763,6 +3741,7 @@ describeRoles(const char *pattern, bool verbose, bool showSystem)
37633741
return false;
37643742

37653743
nrows = PQntuples(res);
3744+
37663745
attr = pg_malloc0((nrows + 1) * sizeof(*attr));
37673746

37683747
printTableInit(&cont, &myopt, _("List of roles"), ncols, nrows);
@@ -5404,20 +5383,6 @@ listTSParsersVerbose(const char *pattern)
54045383
if (!res)
54055384
return false;
54065385

5407-
if (PQntuples(res) == 0)
5408-
{
5409-
if (!pset.quiet)
5410-
{
5411-
if (pattern)
5412-
pg_log_error("Did not find any text search parser named \"%s\".",
5413-
pattern);
5414-
else
5415-
pg_log_error("Did not find any text search parsers.");
5416-
}
5417-
PQclear(res);
5418-
return false;
5419-
}
5420-
54215386
for (i = 0; i < PQntuples(res); i++)
54225387
{
54235388
const char *oid;
@@ -5782,20 +5747,6 @@ listTSConfigsVerbose(const char *pattern)
57825747
if (!res)
57835748
return false;
57845749

5785-
if (PQntuples(res) == 0)
5786-
{
5787-
if (!pset.quiet)
5788-
{
5789-
if (pattern)
5790-
pg_log_error("Did not find any text search configuration named \"%s\".",
5791-
pattern);
5792-
else
5793-
pg_log_error("Did not find any text search configurations.");
5794-
}
5795-
PQclear(res);
5796-
return false;
5797-
}
5798-
57995750
for (i = 0; i < PQntuples(res); i++)
58005751
{
58015752
const char *oid;
@@ -6257,20 +6208,6 @@ listExtensionContents(const char *pattern)
62576208
if (!res)
62586209
return false;
62596210

6260-
if (PQntuples(res) == 0)
6261-
{
6262-
if (!pset.quiet)
6263-
{
6264-
if (pattern)
6265-
pg_log_error("Did not find any extension named \"%s\".",
6266-
pattern);
6267-
else
6268-
pg_log_error("Did not find any extensions.");
6269-
}
6270-
PQclear(res);
6271-
return false;
6272-
}
6273-
62746211
for (i = 0; i < PQntuples(res); i++)
62756212
{
62766213
const char *extname;
@@ -6604,22 +6541,6 @@ describePublications(const char *pattern)
66046541
return false;
66056542
}
66066543

6607-
if (PQntuples(res) == 0)
6608-
{
6609-
if (!pset.quiet)
6610-
{
6611-
if (pattern)
6612-
pg_log_error("Did not find any publication named \"%s\".",
6613-
pattern);
6614-
else
6615-
pg_log_error("Did not find any publications.");
6616-
}
6617-
6618-
termPQExpBuffer(&buf);
6619-
PQclear(res);
6620-
return false;
6621-
}
6622-
66236544
for (i = 0; i < PQntuples(res); i++)
66246545
{
66256546
const char align = 'l';

0 commit comments

Comments
 (0)