diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index d7b4d2393a1..e1a1d5a1c58 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ - + <application>libpq</application> - C Library @@ -5820,17 +5820,6 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough) - - - - PGINTERVALSTYLE - - PGINTERVALSTYLE sets the default style of interval - representation. (Equivalent to SET intervalstyle TO - ....) - - - diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index e1376dc0173..2cfe36e3a22 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.368 2008/11/13 09:45:24 mha Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.369 2008/11/25 19:30:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -213,9 +213,6 @@ static const PQEnvironmentOption EnvironmentOptions[] = { "PGDATESTYLE", "datestyle" }, - { - "PGINTERVALSTYLE", "intervalstyle" - }, { "PGTZ", "timezone" }, diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index d063602c7e6..f64e00b643f 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.51 2008/11/25 11:49:35 petere Exp $ + * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.52 2008/11/25 19:30:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -716,7 +716,23 @@ initialize_environment(void) */ putenv("PGTZ=PST8PDT"); putenv("PGDATESTYLE=Postgres, MDY"); - putenv("PGINTERVALSTYLE=postgres_verbose"); + + /* + * Likewise set intervalstyle to ensure consistent results. This is a + * bit more painful because we must use PGOPTIONS, and we want to preserve + * the user's ability to set other variables through that. + */ + { + const char *my_pgoptions = "--intervalstyle=postgres_verbose"; + const char *old_pgoptions = getenv("PGOPTIONS"); + char *new_pgoptions; + + if (!old_pgoptions) + old_pgoptions = ""; + new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); + sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); + putenv(new_pgoptions); + } if (temp_install) {