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.
This commit is contained in:
Marc G. Fournier 1997-05-07 03:13:50 +00:00
parent 9f2d714620
commit 8217202134
1 changed files with 3 additions and 8 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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; const char *envName, *pgName;
} EnvironmentOptions[] = } EnvironmentOptions[] =
{ {
{ "PG_DATE", "date" }, { "PG_DATESTYLE", "datestyle" },
{ "PG_TIME", "time" },
{ "PG_FLOAT", "float" },
{ "PG_LANG", "language" },
{ "PG_TZONE", "timezone" },
{ "PG_MONEY", "money" },
{ NULL } { NULL }
}; };
@ -561,7 +556,7 @@ connectDB(PGconn *conn)
{ {
PGresult *res; 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); res = PQexec(conn, setQuery);
PQclear(res); /* Don't care? */ PQclear(res); /* Don't care? */
} }