]> granicus.if.org Git - postgresql/commitdiff
From: "Martin J. Laubach" <mjl@CSlab.tuwien.ac.at>
authorMarc G. Fournier <scrappy@hub.org>
Wed, 7 May 1997 03:13:50 +0000 (03:13 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Wed, 7 May 1997 03:13:50 +0000 (03:13 +0000)
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

index 5fce9f275752deef7ec6df8099f860ffeec97b52..2ea48f4654650c8da33f80d9f7e8661c90b2eb1e 100644 (file)
@@ -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? */
                                }