aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1997-05-07 03:13:50 +0000
committerMarc G. Fournier <scrappy@hub.org>1997-05-07 03:13:50 +0000
commit821720213437d1da3515d8ce12916ca16ee33b8e (patch)
treed7421c5eaaa0907d3472a0452a000c83709ccdf0 /src
parent9f2d7146202c157e85d957e4980f6b3e58c5e9cc (diff)
downloadpostgresql-821720213437d1da3515d8ce12916ca16ee33b8e.tar.gz
postgresql-821720213437d1da3515d8ce12916ca16ee33b8e.zip
From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
Subject: [PATCHES] libpq SET var TO patch One last, I hope. This one corrects a bogus format string, and actually sends the contents of PG_DATESTYLE to the backend. That means, you can do a setenv PG_DATESTYLE 'iso', and your libpq will pick that up and tell the backend.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-connect.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 5fce9f27575..2ea48f46546 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.31 1997/04/17 20:39:23 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.32 1997/05/07 03:13:50 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -106,12 +106,7 @@ struct EnvironmentOptions
const char *envName, *pgName;
} EnvironmentOptions[] =
{
- { "PG_DATE", "date" },
- { "PG_TIME", "time" },
- { "PG_FLOAT", "float" },
- { "PG_LANG", "language" },
- { "PG_TZONE", "timezone" },
- { "PG_MONEY", "money" },
+ { "PG_DATESTYLE", "datestyle" },
{ NULL }
};
@@ -561,7 +556,7 @@ connectDB(PGconn *conn)
{
PGresult *res;
- sprintf(setQuery, "SET %s TO '.60%s'", eo->pgName, val);
+ sprintf(setQuery, "SET %s TO '%.60s'", eo->pgName, val);
res = PQexec(conn, setQuery);
PQclear(res); /* Don't care? */
}