mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Fix timestamptz_in so that parsing of 'now'::timestamptz gives right
answer when SET TIMEZONE has been done since the start of the current transaction. Per bug report from Robert Haas. I plan some futher cleanup in HEAD, but this is a low-risk patch for the immediate issue in 7.3.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.102 2002/12/12 19:16:55 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.103 2003/02/20 05:24:55 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@ -243,25 +243,24 @@ GetCurrentDateTime(struct tm * tm)
|
||||
int tz;
|
||||
|
||||
abstime2tm(GetCurrentTransactionStartTime(), &tz, tm, NULL);
|
||||
|
||||
return;
|
||||
} /* GetCurrentDateTime() */
|
||||
|
||||
|
||||
void
|
||||
GetCurrentTimeUsec(struct tm * tm, fsec_t *fsec)
|
||||
GetCurrentTimeUsec(struct tm * tm, fsec_t *fsec, int *tzp)
|
||||
{
|
||||
int tz;
|
||||
int usec;
|
||||
|
||||
abstime2tm(GetCurrentTransactionStartTimeUsec(&usec), &tz, tm, NULL);
|
||||
/* Note: don't pass NULL tzp directly to abstime2tm */
|
||||
if (tzp != NULL)
|
||||
*tzp = tz;
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
*fsec = usec;
|
||||
#else
|
||||
*fsec = usec * 1.0e-6;
|
||||
#endif
|
||||
|
||||
return;
|
||||
} /* GetCurrentTimeUsec() */
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user