mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Katherine Ward wrote:
> Changes to avoid collisions with WIN32 & MFC names... > 1. Renamed: > a. PROC => PGPROC > b. GetUserName() => GetUserNameFromId() > c. GetCurrentTime() => GetCurrentDateTime() > d. IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim > > 2. Added _P to some lex/yacc tokens: > CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT Jan
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.67 2002/06/01 15:52:15 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.68 2002/06/11 13:40:52 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ date_in(PG_FUNCTION_ARGS)
|
||||
case DTK_CURRENT:
|
||||
elog(ERROR, "Date CURRENT no longer supported"
|
||||
"\n\tdate_in() internal coding error");
|
||||
GetCurrentTime(tm);
|
||||
GetCurrentDateTime(tm);
|
||||
break;
|
||||
|
||||
case DTK_EPOCH:
|
||||
@@ -1697,7 +1697,7 @@ time_timetz(PG_FUNCTION_ARGS)
|
||||
fsec_t fsec;
|
||||
int tz;
|
||||
|
||||
GetCurrentTime(tm);
|
||||
GetCurrentDateTime(tm);
|
||||
time2tm(time, tm, &fsec);
|
||||
tz = DetermineLocalTimeZone(tm);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.90 2002/05/17 01:19:18 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.91 2002/06/11 13:40:52 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ static datetkn datetktbl[] = {
|
||||
{"acst", DTZ, NEG(24)}, /* Atlantic/Porto Acre */
|
||||
{"act", TZ, NEG(30)}, /* Atlantic/Porto Acre */
|
||||
{DA_D, ADBC, AD}, /* "ad" for years >= 0 */
|
||||
{"abstime", IGNORE, 0}, /* for pre-v6.1 "Invalid Abstime" */
|
||||
{"abstime", IGNORE_DTF, 0}, /* for pre-v6.1 "Invalid Abstime" */
|
||||
{"adt", DTZ, NEG(18)}, /* Atlantic Daylight Time */
|
||||
{"aesst", DTZ, 66}, /* E. Australia */
|
||||
{"aest", TZ, 60}, /* Australia Eastern Std Time */
|
||||
@@ -115,7 +115,7 @@ ast /* Atlantic Standard Time, Arabia Standard Time, Acre Standard Time */
|
||||
{"apr", MONTH, 4},
|
||||
{"april", MONTH, 4},
|
||||
{"ast", TZ, NEG(24)}, /* Atlantic Std Time (Canada) */
|
||||
{"at", IGNORE, 0}, /* "at" (throwaway) */
|
||||
{"at", IGNORE_DTF, 0}, /* "at" (throwaway) */
|
||||
{"aug", MONTH, 8},
|
||||
{"august", MONTH, 8},
|
||||
{"awsst", DTZ, 54}, /* W. Australia */
|
||||
@@ -348,7 +348,7 @@ ncst
|
||||
{"october", MONTH, 10},
|
||||
{"omsst", DTZ, 42}, /* Omsk Summer Time */
|
||||
{"omst", TZ, 36}, /* Omsk Time */
|
||||
{"on", IGNORE, 0}, /* "on" (throwaway) */
|
||||
{"on", IGNORE_DTF, 0}, /* "on" (throwaway) */
|
||||
{"pdt", DTZ, NEG(42)}, /* Pacific Daylight Time */
|
||||
#if 0
|
||||
pest
|
||||
@@ -494,7 +494,7 @@ sizeof australian_datetktbl[0];
|
||||
|
||||
static datetkn deltatktbl[] = {
|
||||
/* text, token, lexval */
|
||||
{"@", IGNORE, 0}, /* postgres relative prefix */
|
||||
{"@", IGNORE_DTF, 0}, /* postgres relative prefix */
|
||||
{DAGO, AGO, 0}, /* "ago" indicates negative time offset */
|
||||
{"c", UNITS, DTK_CENTURY}, /* "century" relative */
|
||||
{"cent", UNITS, DTK_CENTURY}, /* "century" relative */
|
||||
@@ -536,7 +536,7 @@ static datetkn deltatktbl[] = {
|
||||
{"msecs", UNITS, DTK_MILLISEC},
|
||||
{"qtr", UNITS, DTK_QUARTER}, /* "quarter" relative */
|
||||
{DQUARTER, UNITS, DTK_QUARTER}, /* "quarter" relative */
|
||||
{"reltime", IGNORE, 0}, /* pre-v6.1 "Undefined Reltime" */
|
||||
{"reltime", IGNORE_DTF, 0}, /* pre-v6.1 "Undefined Reltime" */
|
||||
{"s", UNITS, DTK_SECOND},
|
||||
{"sec", UNITS, DTK_SECOND},
|
||||
{DSECOND, UNITS, DTK_SECOND},
|
||||
@@ -1198,7 +1198,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
|
||||
case DTK_STRING:
|
||||
case DTK_SPECIAL:
|
||||
type = DecodeSpecial(i, field[i], &val);
|
||||
if (type == IGNORE)
|
||||
if (type == IGNORE_DTF)
|
||||
continue;
|
||||
|
||||
tmask = DTK_M(type);
|
||||
@@ -1223,7 +1223,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
|
||||
case DTK_YESTERDAY:
|
||||
tmask = DTK_DATE_M;
|
||||
*dtype = DTK_DATE;
|
||||
GetCurrentTime(tm);
|
||||
GetCurrentDateTime(tm);
|
||||
j2date((date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - 1),
|
||||
&tm->tm_year, &tm->tm_mon, &tm->tm_mday);
|
||||
tm->tm_hour = 0;
|
||||
@@ -1234,7 +1234,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
|
||||
case DTK_TODAY:
|
||||
tmask = DTK_DATE_M;
|
||||
*dtype = DTK_DATE;
|
||||
GetCurrentTime(tm);
|
||||
GetCurrentDateTime(tm);
|
||||
tm->tm_hour = 0;
|
||||
tm->tm_min = 0;
|
||||
tm->tm_sec = 0;
|
||||
@@ -1243,7 +1243,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
|
||||
case DTK_TOMORROW:
|
||||
tmask = DTK_DATE_M;
|
||||
*dtype = DTK_DATE;
|
||||
GetCurrentTime(tm);
|
||||
GetCurrentDateTime(tm);
|
||||
j2date((date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + 1),
|
||||
&tm->tm_year, &tm->tm_mon, &tm->tm_mday);
|
||||
tm->tm_hour = 0;
|
||||
@@ -1319,7 +1319,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
|
||||
ftype[i] = DTK_TZ;
|
||||
break;
|
||||
|
||||
case IGNORE:
|
||||
case IGNORE_DTF:
|
||||
break;
|
||||
|
||||
case AMPM:
|
||||
@@ -1815,7 +1815,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
|
||||
case DTK_STRING:
|
||||
case DTK_SPECIAL:
|
||||
type = DecodeSpecial(i, field[i], &val);
|
||||
if (type == IGNORE)
|
||||
if (type == IGNORE_DTF)
|
||||
continue;
|
||||
|
||||
tmask = DTK_M(type);
|
||||
@@ -1885,7 +1885,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
|
||||
ftype[i] = DTK_TZ;
|
||||
break;
|
||||
|
||||
case IGNORE:
|
||||
case IGNORE_DTF:
|
||||
break;
|
||||
|
||||
case AMPM:
|
||||
@@ -1967,7 +1967,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
|
||||
|
||||
if ((fmask & DTK_DATE_M) == 0)
|
||||
{
|
||||
GetCurrentTime(tmp);
|
||||
GetCurrentDateTime(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2043,7 +2043,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm)
|
||||
if (isalpha((unsigned char) *field[i]))
|
||||
{
|
||||
type = DecodeSpecial(i, field[i], &val);
|
||||
if (type == IGNORE)
|
||||
if (type == IGNORE_DTF)
|
||||
continue;
|
||||
|
||||
dmask = DTK_M(type);
|
||||
@@ -2576,7 +2576,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
|
||||
|
||||
*dtype = DTK_DELTA;
|
||||
|
||||
type = IGNORE;
|
||||
type = IGNORE_DTF;
|
||||
tm->tm_year = 0;
|
||||
tm->tm_mon = 0;
|
||||
tm->tm_mday = 0;
|
||||
@@ -2633,7 +2633,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
|
||||
tmask = DTK_M(TZ);
|
||||
break;
|
||||
}
|
||||
else if (type == IGNORE)
|
||||
else if (type == IGNORE_DTF)
|
||||
{
|
||||
if (*cp == '.')
|
||||
{
|
||||
@@ -2658,7 +2658,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
|
||||
case DTK_NUMBER:
|
||||
val = strtol(field[i], &cp, 10);
|
||||
|
||||
if (type == IGNORE)
|
||||
if (type == IGNORE_DTF)
|
||||
type = DTK_SECOND;
|
||||
|
||||
if (*cp == '.')
|
||||
@@ -2826,7 +2826,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
|
||||
case DTK_STRING:
|
||||
case DTK_SPECIAL:
|
||||
type = DecodeUnits(i, field[i], &val);
|
||||
if (type == IGNORE)
|
||||
if (type == IGNORE_DTF)
|
||||
continue;
|
||||
|
||||
tmask = 0; /* DTK_M(type); */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.93 2002/04/21 19:48:12 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.94 2002/06/11 13:40:52 wieck Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -239,14 +239,14 @@ GetCurrentAbsoluteTimeUsec(int *usec)
|
||||
|
||||
|
||||
void
|
||||
GetCurrentTime(struct tm * tm)
|
||||
GetCurrentDateTime(struct tm * tm)
|
||||
{
|
||||
int tz;
|
||||
|
||||
abstime2tm(GetCurrentTransactionStartTime(), &tz, tm, NULL);
|
||||
|
||||
return;
|
||||
} /* GetCurrentTime() */
|
||||
} /* GetCurrentDateTime() */
|
||||
|
||||
|
||||
void
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.35 2002/05/17 20:53:33 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.36 2002/06/11 13:40:52 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -219,13 +219,13 @@ namestrcmp(Name name, const char *str)
|
||||
Datum
|
||||
current_user(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserName(GetUserId()))));
|
||||
PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserNameFromId(GetUserId()))));
|
||||
}
|
||||
|
||||
Datum
|
||||
session_user(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserName(GetSessionUserId()))));
|
||||
PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserNameFromId(GetSessionUserId()))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user