From 821720213437d1da3515d8ce12916ca16ee33b8e Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Wed, 7 May 1997 03:13:50 +0000 Subject: [PATCH] From: "Martin J. Laubach" 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. --- src/interfaces/libpq/fe-connect.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 5fce9f2757..2ea48f4654 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? */ }