aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-01-11 18:33:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-01-11 18:33:46 +0000
commitd3d00715e21c6ced9fc833d791250a251bc455e1 (patch)
tree1d852d4bef4a3fd344bd95c96e6ddc4e669c823e /src
parent5f0a4684547032d2bc821bf14fc3afd27539c0e4 (diff)
downloadpostgresql-d3d00715e21c6ced9fc833d791250a251bc455e1.tar.gz
postgresql-d3d00715e21c6ced9fc833d791250a251bc455e1.zip
interval_out failed to mention 'ago' for negative intervals in SQL and
GERMAN datestyles. Ancient bug reported by Terry Lee Tucker.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/datetime.c4
-rw-r--r--src/interfaces/ecpg/pgtypeslib/interval.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index e98475fb920..47dc28d1326 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.136 2004/12/31 22:01:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.137 2005/01/11 18:33:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3932,7 +3932,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
cp += strlen(cp);
}
- if (is_before && (style == USE_POSTGRES_DATES))
+ if (is_before && (style != USE_ISO_DATES))
{
strcat(cp, " ago");
cp += strlen(cp);
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index e1d34e8a7b2..7a06069634c 100644
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -663,7 +663,7 @@ EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str)
cp += strlen(cp);
}
- if (is_before && (style == USE_POSTGRES_DATES))
+ if (is_before && (style != USE_ISO_DATES))
{
strcat(cp, " ago");
cp += strlen(cp);