client_message.patch
text/x-patch
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: unified
| File | + | − |
|---|---|---|
| doc/src/sgml/config.sgml | 0 | 0 |
| src/backend/utils/misc/guc.c | 0 | 0 |
| src/backend/utils/misc/postgresql.conf.sample | 0 | 0 |
| src/bin/psql/command.c | 0 | 0 |
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index 0cc3296..fa5b942
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** dynamic_library_path = 'C:\tools\postgre
*** 5323,5328 ****
--- 5323,5341 ----
</listitem>
</varlistentry>
+ <varlistentry id="guc-client-message" xreflabel="client_message">
+ <term><varname>client_message</varname> (<type>string</type>)</term>
+ <indexterm>
+ <primary><varname>client_message</> configuration parameter</primary>
+ </indexterm>
+ <listitem>
+ <para>
+ The <varname>client_message</varname> can be any string that will be
+ displayed to the user in the banner of psql.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</sect2>
</sect1>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
new file mode 100644
index 5c910dd..58b6000
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
*************** static char *log_destination_string;
*** 455,460 ****
--- 455,461 ----
static char *syslog_ident_str;
static bool phony_autocommit;
static bool session_auth_is_superuser;
+ static char *client_message_string;
static double phony_random_seed;
static char *client_encoding_string;
static char *datestyle_string;
*************** static struct config_string ConfigureNam
*** 3018,3023 ****
--- 3019,3035 ----
check_application_name, assign_application_name, NULL
},
+ {
+ {"client_message", PGC_USERSET, CLIENT_CONN_OTHER,
+ gettext_noop("Sets a message to be displayed to the user when connecting via psql."),
+ NULL,
+ GUC_REPORT | GUC_NO_SHOW_ALL
+ },
+ &client_message_string,
+ "",
+ NULL, NULL, NULL
+ },
+
/* End-of-list marker */
{
{NULL, 0, 0, NULL, NULL}, NULL, NULL, NULL, NULL, NULL
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
new file mode 100644
index 315db46..8eb5af5
*** a/src/backend/utils/misc/postgresql.conf.sample
--- b/src/backend/utils/misc/postgresql.conf.sample
***************
*** 515,520 ****
--- 515,521 ----
#dynamic_library_path = '$libdir'
#local_preload_libraries = ''
+ #client_message = ''
#------------------------------------------------------------------------------
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
new file mode 100644
index 69fac83..44bf114
*** a/src/bin/psql/command.c
--- b/src/bin/psql/command.c
*************** static bool get_create_function_cmd(PGco
*** 65,70 ****
--- 65,71 ----
static int strip_lineno_from_funcdesc(char *func);
static void minimal_error_message(PGresult *res);
+ static void printClientMessage(void);
static void printSSLInfo(void);
#ifdef WIN32
*************** connection_warnings(bool in_startup)
*** 1699,1709 ****
--- 1700,1729 ----
checkWin32Codepage();
#endif
printSSLInfo();
+
+ printClientMessage();
}
}
/*
+ * printClientMessage
+ *
+ * Prints any message stored in the client_message GUC
+ */
+ static void
+ printClientMessage(void)
+ {
+ const char *message;
+
+ message = PQparameterStatus(pset.db, "client_message");
+
+ if (message)
+ printf(_("%s\n"), message);
+ }
+
+
+ /*
* printSSLInfo
*
* Prints information about the current SSL connection, if SSL is in use