psql_constraints-2.patch

text/plain

Filename: psql_constraints-2.patch
Type: text/plain
Part: 0
Message: review patch: Distinguish between unique indexes and unique constraints

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: context
File+
src/bin/psql/describe.c 4 0
*** a/src/bin/psql/describe.c
--- b/src/bin/psql/describe.c
***************
*** 1592,1598 **** describeOneTableDetails(const char *schemaname,
--- 1592,1602 ----
  						if (strcmp(PQgetvalue(result, i, 1), "t") == 0)
  							appendPQExpBuffer(&buf, " PRIMARY KEY,");
  						else if (strcmp(PQgetvalue(result, i, 2), "t") == 0)
+ 						{
  							appendPQExpBuffer(&buf, " UNIQUE,");
+ 							if (verbose && strcmp(PQgetvalue(result, i, 7), "u") == 0)
+ 								appendPQExpBuffer(&buf, " CONSTRAINT,");
+ 						}
  
  						/* Everything after "USING" is echoed verbatim */
  						indexdef = PQgetvalue(result, i, 5);