summaryrefslogtreecommitdiffstats
path: root/src/interfaces/ecpg/test/sql/show.pgc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:46:48 +0000
commit311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 (patch)
tree0ec307299b1dada3701e42f4ca6eda57d708261e /src/interfaces/ecpg/test/sql/show.pgc
parentInitial commit. (diff)
downloadpostgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.tar.xz
postgresql-15-311bcfc6b3acdd6fd152798c7f287ddf74fa2a98.zip
Adding upstream version 15.4.upstream/15.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/interfaces/ecpg/test/sql/show.pgc')
-rw-r--r--src/interfaces/ecpg/test/sql/show.pgc41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/test/sql/show.pgc b/src/interfaces/ecpg/test/sql/show.pgc
new file mode 100644
index 0000000..339678a
--- /dev/null
+++ b/src/interfaces/ecpg/test/sql/show.pgc
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+EXEC SQL INCLUDE ../regression;
+
+int main() {
+ EXEC SQL BEGIN DECLARE SECTION;
+ char var[25] = "public";
+ EXEC SQL END DECLARE SECTION;
+
+ ECPGdebug(1, stderr);
+ EXEC SQL CONNECT TO REGRESSDB1;
+
+ EXEC SQL WHENEVER SQLWARNING SQLPRINT;
+ EXEC SQL WHENEVER SQLERROR SQLPRINT;
+
+ EXEC SQL SET search_path TO :var;
+ EXEC SQL SHOW search_path INTO :var;
+ printf("Var: Search path: %s\n", var);
+
+ EXEC SQL SET search_path TO 'public';
+ EXEC SQL SHOW search_path INTO :var;
+ printf("Var: Search path: %s\n", var);
+
+ EXEC SQL SET standard_conforming_strings TO off;
+ EXEC SQL SHOW standard_conforming_strings INTO :var;
+ printf("Var: Standard conforming strings: %s\n", var);
+
+ EXEC SQL SET TIME ZONE PST8PDT;
+ EXEC SQL SHOW TIME ZONE INTO :var;
+ printf("Time Zone: %s\n", var);
+
+ EXEC SQL SET TRANSACTION ISOLATION LEVEL read committed;
+ EXEC SQL SHOW TRANSACTION ISOLATION LEVEL INTO :var;
+ printf("Transaction isolation level: %s\n", var);
+
+ EXEC SQL DISCONNECT ALL;
+
+ return 0;
+}