aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/date.c34
-rw-r--r--src/backend/utils/adt/datetime.c8
-rw-r--r--src/backend/utils/adt/formatting.c4
-rw-r--r--src/backend/utils/adt/nabstime.c32
-rw-r--r--src/backend/utils/adt/numeric.c4
-rw-r--r--src/backend/utils/adt/selfuncs.c6
-rw-r--r--src/backend/utils/adt/timestamp.c222
-rw-r--r--src/backend/utils/fmgr/fmgr.c27
-rw-r--r--src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c6
-rw-r--r--src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c4
-rw-r--r--src/backend/utils/misc/guc.c10
-rw-r--r--src/backend/utils/resowner/resowner.c4
12 files changed, 200 insertions, 161 deletions
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index fcded9b763c..66f5fd8cfea 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.102 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.103 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -55,7 +55,7 @@ Datum
date_in(PG_FUNCTION_ARGS)
{
char *str = PG_GETARG_CSTRING(0);
- DateADT date;
+ DateADT date;
fsec_t fsec;
struct pg_tm tt,
*tm = &tt;
@@ -109,13 +109,13 @@ date_in(PG_FUNCTION_ARGS)
Datum
date_out(PG_FUNCTION_ARGS)
{
- DateADT date = PG_GETARG_DATEADT(0);
+ DateADT date = PG_GETARG_DATEADT(0);
char *result;
struct pg_tm tt,
*tm = &tt;
char buf[MAXDATELEN + 1];
- j2date(date + POSTGRES_EPOCH_JDATE,
+ j2date(date +POSTGRES_EPOCH_JDATE,
&(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday));
EncodeDateOnly(tm, DateStyle, buf);
@@ -141,7 +141,7 @@ date_recv(PG_FUNCTION_ARGS)
Datum
date_send(PG_FUNCTION_ARGS)
{
- DateADT date = PG_GETARG_DATEADT(0);
+ DateADT date = PG_GETARG_DATEADT(0);
StringInfoData buf;
pq_begintypsend(&buf);
@@ -717,7 +717,7 @@ date_timestamp(PG_FUNCTION_ARGS)
Datum
timestamp_date(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
DateADT result;
struct pg_tm tt,
*tm = &tt;
@@ -726,7 +726,7 @@ timestamp_date(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -769,7 +769,7 @@ timestamptz_date(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -823,7 +823,7 @@ Datum
date_text(PG_FUNCTION_ARGS)
{
/* Input is a Date, but may as well leave it in Datum form */
- Datum date = PG_GETARG_DATUM(0);
+ Datum date = PG_GETARG_DATUM(0);
text *result;
char *str;
int len;
@@ -1322,7 +1322,7 @@ overlaps_time(PG_FUNCTION_ARGS)
Datum
timestamp_time(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
TimeADT result;
struct pg_tm tt,
*tm = &tt;
@@ -1331,7 +1331,7 @@ timestamp_time(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -1368,7 +1368,7 @@ timestamptz_time(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -1394,7 +1394,7 @@ timestamptz_time(PG_FUNCTION_ARGS)
Datum
datetime_timestamp(PG_FUNCTION_ARGS)
{
- DateADT date = PG_GETARG_DATEADT(0);
+ DateADT date = PG_GETARG_DATEADT(0);
TimeADT time = PG_GETARG_TIMEADT(1);
Timestamp result;
@@ -2246,7 +2246,7 @@ timestamptz_timetz(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
PG_RETURN_NULL();
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -2268,15 +2268,15 @@ timestamptz_timetz(PG_FUNCTION_ARGS)
Datum
datetimetz_timestamptz(PG_FUNCTION_ARGS)
{
- DateADT date = PG_GETARG_DATEADT(0);
+ DateADT date = PG_GETARG_DATEADT(0);
TimeTzADT *time = PG_GETARG_TIMETZADT_P(1);
TimestampTz result;
#ifdef HAVE_INT64_TIMESTAMP
- result = (((date * INT64CONST(86400000000)) + time->time)
+ result = (((date *INT64CONST(86400000000)) +time->time)
+ (time->zone * INT64CONST(1000000)));
#else
- result = (((date * 86400.0) + time->time) + time->zone);
+ result = (((date *86400.0) +time->time) + time->zone);
#endif
PG_RETURN_TIMESTAMP(result);
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 6e0311d8ae7..4459d286c96 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.133 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.134 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -666,6 +666,7 @@ j2day(int date)
unsigned int day;
day = date;
+
day += 1;
day %= 7;
@@ -1585,7 +1586,7 @@ int
DetermineLocalTimeZone(struct pg_tm * tm)
{
int tz;
- int date,
+ int date ,
sec;
pg_time_t day,
mysec,
@@ -1609,7 +1610,8 @@ DetermineLocalTimeZone(struct pg_tm * tm)
if (!IS_VALID_JULIAN(tm->tm_year, tm->tm_mon, tm->tm_mday))
goto overflow;
date = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - UNIX_EPOCH_JDATE;
- day = ((pg_time_t) date) * 86400;
+
+ day = ((pg_time_t) date) *86400;
if (day / 86400 != date)
goto overflow;
sec = tm->tm_sec + (tm->tm_min + tm->tm_hour * 60) * 60;
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 13c23bb57a5..369353e6ce0 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.77 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.78 2004/08/30 02:54:39 momjian Exp $
*
*
* Portions Copyright (c) 1999-2004, PostgreSQL Global Development Group
@@ -3556,6 +3556,7 @@ NUM_prepare_locale(NUMProc *Np)
*/
if (lconv->decimal_point && *lconv->decimal_point)
Np->decimal = lconv->decimal_point;
+
else
Np->decimal = ".";
@@ -3579,6 +3580,7 @@ NUM_prepare_locale(NUMProc *Np)
Np->L_negative_sign = "-";
Np->L_positive_sign = "+";
Np->decimal = ".";
+
Np->L_thousands_sep = ",";
Np->L_currency_symbol = " ";
}
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c
index 4a2e862fb7e..09c5b661293 100644
--- a/src/backend/utils/adt/nabstime.c
+++ b/src/backend/utils/adt/nabstime.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.125 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.126 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -547,7 +547,7 @@ btabstimecmp(PG_FUNCTION_ARGS)
Datum
timestamp_abstime(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
AbsoluteTime result;
fsec_t fsec;
int tz;
@@ -816,6 +816,7 @@ tintervalin(PG_FUNCTION_ARGS)
t2;
interval = (TimeInterval) palloc(sizeof(TimeIntervalData));
+
if (istinterval(intervalstr, &t1, &t2) == 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_DATETIME_FORMAT),
@@ -823,14 +824,15 @@ tintervalin(PG_FUNCTION_ARGS)
intervalstr)));
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
- interval->status = T_INTERVAL_INVAL; /* undefined */
+ interval ->status = T_INTERVAL_INVAL; /* undefined */
+
else
- interval->status = T_INTERVAL_VALID;
+ interval ->status = T_INTERVAL_VALID;
i_start = ABSTIMEMIN(t1, t2);
i_end = ABSTIMEMAX(t1, t2);
- interval->data[0] = i_start;
- interval->data[1] = i_end;
+ interval ->data[0] = i_start;
+ interval ->data[1] = i_end;
PG_RETURN_TIMEINTERVAL(interval);
}
@@ -877,15 +879,16 @@ tintervalrecv(PG_FUNCTION_ARGS)
interval = (TimeInterval) palloc(sizeof(TimeIntervalData));
- interval->status = pq_getmsgint(buf, sizeof(interval->status));
+ interval ->status = pq_getmsgint(buf, sizeof(interval->status));
+
if (!(interval->status == T_INTERVAL_INVAL ||
interval->status == T_INTERVAL_VALID))
ereport(ERROR,
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
errmsg("invalid status in external \"tinterval\" value")));
- interval->data[0] = pq_getmsgint(buf, sizeof(interval->data[0]));
- interval->data[1] = pq_getmsgint(buf, sizeof(interval->data[1]));
+ interval ->data[0] = pq_getmsgint(buf, sizeof(interval->data[0]));
+ interval ->data[1] = pq_getmsgint(buf, sizeof(interval->data[1]));
PG_RETURN_TIMEINTERVAL(interval);
}
@@ -931,7 +934,7 @@ interval_reltime(PG_FUNCTION_ARGS)
year = 0;
month = 0;
}
- else if (abs(interval->month) >= 12)
+ else if (abs(interval->month) >=12)
{
year = (interval->month / 12);
month = (interval->month % 12);
@@ -1016,12 +1019,13 @@ mktinterval(PG_FUNCTION_ARGS)
interval = (TimeInterval) palloc(sizeof(TimeIntervalData));
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
- interval->status = T_INTERVAL_INVAL;
+ interval ->status = T_INTERVAL_INVAL;
+
else
{
- interval->status = T_INTERVAL_VALID;
- interval->data[0] = tstart;
- interval->data[1] = tend;
+ interval ->status = T_INTERVAL_VALID;
+ interval ->data[0] = tstart;
+ interval ->data[1] = tend;
}
PG_RETURN_TIMEINTERVAL(interval);
diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c
index 9c312643c57..9c8abfb365a 100644
--- a/src/backend/utils/adt/numeric.c
+++ b/src/backend/utils/adt/numeric.c
@@ -14,7 +14,7 @@
* Copyright (c) 1998-2004, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.78 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/numeric.c,v 1.79 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -462,7 +462,7 @@ numeric_send(PG_FUNCTION_ARGS)
* scale of the attribute have to be applied on the value.
*/
Datum
-numeric(PG_FUNCTION_ARGS)
+numeric (PG_FUNCTION_ARGS)
{
Numeric num = PG_GETARG_NUMERIC(0);
int32 typmod = PG_GETARG_INT32(1);
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index b1f66d9c9a5..412a0a32310 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.164 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.165 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2755,7 +2755,7 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
return (interval->time + (interval->month * ((365.25 / 12.0) * 86400000000.0)));
#else
return interval->time +
- interval->month * (365.25 / 12.0 * 24.0 * 60.0 * 60.0);
+ interval ->month * (365.25 / 12.0 * 24.0 * 60.0 * 60.0);
#endif
}
case RELTIMEOID:
@@ -2770,7 +2770,7 @@ convert_timevalue_to_scalar(Datum value, Oid typid)
#ifdef HAVE_INT64_TIMESTAMP
if (interval->status != 0)
- return ((interval->data[1] - interval->data[0]) * 1000000.0);
+ return ((interval->data[1] - interval->data[0]) *1000000.0);
#else
if (interval->status != 0)
return interval->data[1] - interval->data[0];
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 375ff130682..83286502e81 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.112 2004/08/29 05:06:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.113 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -135,7 +135,7 @@ timestamp_in(PG_FUNCTION_ARGS)
Datum
timestamp_out(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
char *result;
struct pg_tm tt,
*tm = &tt;
@@ -166,13 +166,14 @@ Datum
timestamp_recv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
- Timestamp timestamp;
+ Timestamp timestamp;
struct pg_tm tt,
*tm = &tt;
fsec_t fsec;
#ifdef HAVE_INT64_TIMESTAMP
timestamp = (Timestamp) pq_getmsgint64(buf);
+
#else
timestamp = (Timestamp) pq_getmsgfloat8(buf);
#endif
@@ -180,7 +181,7 @@ timestamp_recv(PG_FUNCTION_ARGS)
/* rangecheck: see if timestamp_out would like it */
if (TIMESTAMP_NOT_FINITE(timestamp))
/* ok */ ;
- else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -194,7 +195,7 @@ timestamp_recv(PG_FUNCTION_ARGS)
Datum
timestamp_send(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
StringInfoData buf;
pq_begintypsend(&buf);
@@ -214,7 +215,7 @@ timestamp_send(PG_FUNCTION_ARGS)
Datum
timestamp_scale(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
int32 typmod = PG_GETARG_INT32(1);
Timestamp result;
@@ -416,6 +417,7 @@ timestamptz_recv(PG_FUNCTION_ARGS)
#ifdef HAVE_INT64_TIMESTAMP
timestamp = (TimestampTz) pq_getmsgint64(buf);
+
#else
timestamp = (TimestampTz) pq_getmsgfloat8(buf);
#endif
@@ -423,7 +425,7 @@ timestamptz_recv(PG_FUNCTION_ARGS)
/* rangecheck: see if timestamptz_out would like it */
if (TIMESTAMP_NOT_FINITE(timestamp))
/* ok */ ;
- else if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ else if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -577,11 +579,12 @@ interval_recv(PG_FUNCTION_ARGS)
interval = (Interval *) palloc(sizeof(Interval));
#ifdef HAVE_INT64_TIMESTAMP
- interval->time = pq_getmsgint64(buf);
+ interval ->time = pq_getmsgint64(buf);
+
#else
- interval->time = pq_getmsgfloat8(buf);
+ interval ->time = pq_getmsgfloat8(buf);
#endif
- interval->month = pq_getmsgint(buf, sizeof(interval->month));
+ interval ->month = pq_getmsgint(buf, sizeof(interval->month));
PG_RETURN_INTERVAL_P(interval);
}
@@ -676,25 +679,28 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
}
else if (range == INTERVAL_MASK(YEAR))
{
- interval->month = ((interval->month / 12) * 12);
- interval->time = 0;
+ interval ->month = ((interval->month / 12) *12);
+ interval ->time = 0;
}
else if (range == INTERVAL_MASK(MONTH))
{
- interval->month %= 12;
- interval->time = 0;
+ interval ->month %= 12;
+ interval ->time = 0;
}
/* YEAR TO MONTH */
else if (range == (INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH)))
- interval->time = 0;
+ interval ->time = 0;
+
else if (range == INTERVAL_MASK(DAY))
{
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
- interval->time = (((int) (interval->time / INT64CONST(86400000000)))
- * INT64CONST(86400000000));
+ interval ->time = (((int) (interval->time / INT64CONST(86400000000)))
+ * INT64CONST(86400000000));
+
#else
- interval->time = (((int) (interval->time / 86400)) * 86400);
+ interval ->time = (((int) (interval->time / 86400)) * 86400);
#endif
}
else if (range == INTERVAL_MASK(HOUR))
@@ -706,15 +712,17 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double day;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
day = (interval->time / INT64CONST(86400000000));
- interval->time -= (day * INT64CONST(86400000000));
- interval->time = ((interval->time / INT64CONST(3600000000))
- * INT64CONST(3600000000));
+ interval ->time -= (day * INT64CONST(86400000000));
+ interval ->time = ((interval->time / INT64CONST(3600000000))
+ *INT64CONST(3600000000));
+
#else
TMODULO(interval->time, day, 86400.0);
- interval->time = (((int) (interval->time / 3600)) * 3600.0);
+ interval ->time = (((int) (interval->time / 3600)) * 3600.0);
#endif
}
else if (range == INTERVAL_MASK(MINUTE))
@@ -726,15 +734,17 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double hour;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
hour = (interval->time / INT64CONST(3600000000));
- interval->time -= (hour * INT64CONST(3600000000));
- interval->time = ((interval->time / INT64CONST(60000000))
- * INT64CONST(60000000));
+ interval ->time -= (hour * INT64CONST(3600000000));
+ interval ->time = ((interval->time / INT64CONST(60000000))
+ *INT64CONST(60000000));
+
#else
TMODULO(interval->time, hour, 3600.0);
- interval->time = (((int) (interval->time / 60)) * 60);
+ interval ->time = (((int) (interval->time / 60)) * 60);
#endif
}
else if (range == INTERVAL_MASK(SECOND))
@@ -746,10 +756,12 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double minute;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
minute = (interval->time / INT64CONST(60000000));
- interval->time -= (minute * INT64CONST(60000000));
+ interval ->time -= (minute * INT64CONST(60000000));
+
#else
TMODULO(interval->time, minute, 60.0);
/* interval->time = (int)(interval->time); */
@@ -759,12 +771,14 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
else if (range == (INTERVAL_MASK(DAY) |
INTERVAL_MASK(HOUR)))
{
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
- interval->time = ((interval->time / INT64CONST(3600000000))
- * INT64CONST(3600000000));
+ interval ->time = ((interval->time / INT64CONST(3600000000))
+ *INT64CONST(3600000000));
+
#else
- interval->time = (((int) (interval->time / 3600)) * 3600);
+ interval ->time = (((int) (interval->time / 3600)) * 3600);
#endif
}
/* DAY TO MINUTE */
@@ -772,12 +786,14 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
INTERVAL_MASK(HOUR) |
INTERVAL_MASK(MINUTE)))
{
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
- interval->time = ((interval->time / INT64CONST(60000000))
- * INT64CONST(60000000));
+ interval ->time = ((interval->time / INT64CONST(60000000))
+ *INT64CONST(60000000));
+
#else
- interval->time = (((int) (interval->time / 60)) * 60);
+ interval ->time = (((int) (interval->time / 60)) * 60);
#endif
}
/* DAY TO SECOND */
@@ -785,7 +801,8 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
INTERVAL_MASK(HOUR) |
INTERVAL_MASK(MINUTE) |
INTERVAL_MASK(SECOND)))
- interval->month = 0;
+ interval ->month = 0;
+
/* HOUR TO MINUTE */
else if (range == (INTERVAL_MASK(HOUR) |
INTERVAL_MASK(MINUTE)))
@@ -797,15 +814,17 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double day;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
day = (interval->time / INT64CONST(86400000000));
- interval->time -= (day * INT64CONST(86400000000));
- interval->time = ((interval->time / INT64CONST(60000000))
- * INT64CONST(60000000));
+ interval ->time -= (day * INT64CONST(86400000000));
+ interval ->time = ((interval->time / INT64CONST(60000000))
+ *INT64CONST(60000000));
+
#else
TMODULO(interval->time, day, 86400.0);
- interval->time = (((int) (interval->time / 60)) * 60);
+ interval ->time = (((int) (interval->time / 60)) * 60);
#endif
}
/* HOUR TO SECOND */
@@ -820,10 +839,12 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double day;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
day = (interval->time / INT64CONST(86400000000));
- interval->time -= (day * INT64CONST(86400000000));
+ interval ->time -= (day * INT64CONST(86400000000));
+
#else
TMODULO(interval->time, day, 86400.0);
#endif
@@ -839,10 +860,12 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
double hour;
#endif
- interval->month = 0;
+ interval ->month = 0;
+
#ifdef HAVE_INT64_TIMESTAMP
hour = (interval->time / INT64CONST(3600000000));
- interval->time -= (hour * INT64CONST(3600000000));
+ interval ->time -= (hour * INT64CONST(3600000000));
+
#else
TMODULO(interval->time, hour, 3600.0);
#endif
@@ -870,17 +893,17 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
#ifdef HAVE_INT64_TIMESTAMP
if (interval->time >= INT64CONST(0))
{
- interval->time = (((interval->time + IntervalOffsets[precision]) / IntervalScales[precision])
- * IntervalScales[precision]);
+ interval ->time = (((interval->time + IntervalOffsets[precision]) /IntervalScales[precision])
+ * IntervalScales[precision]);
}
else
{
- interval->time = -(((-interval->time + IntervalOffsets[precision]) / IntervalScales[precision])
- * IntervalScales[precision]);
+ interval ->time = -(((-interval->time + IntervalOffsets[precision]) /IntervalScales[precision])
+ * IntervalScales[precision]);
}
#else
- interval->time = (rint(((double) interval->time) * IntervalScales[precision])
- / IntervalScales[precision]);
+ interval ->time = (rint(((double) interval->time) *IntervalScales[precision])
+ / IntervalScales[precision]);
#endif
}
}
@@ -963,7 +986,7 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
int
timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, char **tzn)
{
- Timestamp date;
+ Timestamp date;
Timestamp time;
pg_time_t utime;
@@ -988,7 +1011,7 @@ timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, char **tzn
if (time < INT64CONST(0))
{
time += INT64CONST(86400000000);
- date -= 1;
+ date -=1;
}
#else
TMODULO(time, date, 86400e0);
@@ -996,15 +1019,15 @@ timestamp2tm(Timestamp dt, int *tzp, struct pg_tm * tm, fsec_t *fsec, char **tzn
if (time < 0)
{
time += 86400;
- date -= 1;
+ date -=1;
}
#endif
/* add offset to go from J2000 back to standard Julian date */
- date += POSTGRES_EPOCH_JDATE;
+ date +=POSTGRES_EPOCH_JDATE;
/* Julian day routine does not work for negative Julian days */
- if (date < 0 || date > (Timestamp) INT_MAX)
+ if (date <0 || date >(Timestamp) INT_MAX)
return -1;
j2date((int) date, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
@@ -1100,11 +1123,11 @@ int
tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
{
#ifdef HAVE_INT64_TIMESTAMP
- int date;
+ int date;
int64 time;
#else
- double date,
+ double date,
time;
#endif
@@ -1113,17 +1136,18 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
return -1;
date = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - POSTGRES_EPOCH_JDATE;
+
time = time2t(tm->tm_hour, tm->tm_min, tm->tm_sec, fsec);
#ifdef HAVE_INT64_TIMESTAMP
- *result = (date * INT64CONST(86400000000)) + time;
+ *result = (date *INT64CONST(86400000000)) +time;
/* check for major overflow */
if ((*result - time) / INT64CONST(86400000000) != date)
return -1;
/* check for just-barely overflow (okay except time-of-day wraps) */
- if ((*result < 0) ? (date >= 0) : (date < 0))
+ if ((*result < 0) ? (date >=0) : (date <0))
return -1;
#else
- *result = ((date * 86400) + time);
+ *result = ((date *86400) +time);
#endif
if (tzp != NULL)
*result = dt2local(*result, -(*tzp));
@@ -1235,7 +1259,7 @@ dt2local(Timestamp dt, int tz)
Datum
timestamp_finite(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
PG_RETURN_BOOL(!TIMESTAMP_NOT_FINITE(timestamp));
}
@@ -1884,12 +1908,13 @@ timestamp_mi(PG_FUNCTION_ARGS)
Datum
timestamp_pl_interval(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
Interval *span = PG_GETARG_INTERVAL_P(1);
Timestamp result;
if (TIMESTAMP_NOT_FINITE(timestamp))
result = timestamp;
+
else
{
if (span->month != 0)
@@ -1898,7 +1923,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
*tm = &tt;
fsec_t fsec;
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -1919,13 +1944,13 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
if (tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1])
tm->tm_mday = (day_tab[isleap(tm->tm_year)][tm->tm_mon - 1]);
- if (tm2timestamp(tm, fsec, NULL, &timestamp) != 0)
+ if (tm2timestamp(tm, fsec, NULL, &timestamp) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
}
- timestamp += span->time;
+ timestamp +=span->time;
result = timestamp;
}
@@ -1935,7 +1960,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
Datum
timestamp_mi_interval(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
Interval *span = PG_GETARG_INTERVAL_P(1);
Interval tspan;
@@ -1968,6 +1993,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
result = timestamp;
+
else
{
if (span->month != 0)
@@ -1976,7 +2002,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
*tm = &tt;
fsec_t fsec;
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -1999,13 +2025,13 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
tz = DetermineLocalTimeZone(tm);
- if (tm2timestamp(tm, fsec, &tz, &timestamp) != 0)
+ if (tm2timestamp(tm, fsec, &tz, &timestamp) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
}
- timestamp += span->time;
+ timestamp +=span->time;
result = timestamp;
}
@@ -2513,7 +2539,7 @@ Datum
timestamp_text(PG_FUNCTION_ARGS)
{
/* Input is a Timestamp, but may as well leave it in Datum form */
- Datum timestamp = PG_GETARG_DATUM(0);
+ Datum timestamp = PG_GETARG_DATUM(0);
text *result;
char *str;
int len;
@@ -2574,7 +2600,7 @@ Datum
timestamptz_text(PG_FUNCTION_ARGS)
{
/* Input is a Timestamp, but may as well leave it in Datum form */
- Datum timestamp = PG_GETARG_DATUM(0);
+ Datum timestamp = PG_GETARG_DATUM(0);
text *result;
char *str;
int len;
@@ -2694,7 +2720,7 @@ Datum
timestamp_trunc(PG_FUNCTION_ARGS)
{
text *units = PG_GETARG_TEXT_P(0);
- Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
Timestamp result;
int type,
val;
@@ -2714,7 +2740,7 @@ timestamp_trunc(PG_FUNCTION_ARGS)
if (type == UNITS)
{
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -2833,7 +2859,7 @@ timestamptz_trunc(PG_FUNCTION_ARGS)
if (type == UNITS)
{
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3175,7 +3201,7 @@ Datum
timestamp_part(PG_FUNCTION_ARGS)
{
text *units = PG_GETARG_TEXT_P(0);
- Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
float8 result;
int type,
val;
@@ -3200,7 +3226,7 @@ timestamp_part(PG_FUNCTION_ARGS)
if (type == UNITS)
{
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3279,9 +3305,9 @@ timestamp_part(PG_FUNCTION_ARGS)
case DTK_CENTURY:
/*
- * centuries AD, c>0: year in [ (c-1)*100+1 : c*100
- * ] centuries BC, c<0: year in [ c*100 :
- * (c+1)*100-1 ] there is no number 0 century.
+ * centuries AD, c>0: year in [ (c-1)*100+1 : c*100 ]
+ * centuries BC, c<0: year in [ c*100 : (c+1)*100-1
+ * ] there is no number 0 century.
*/
if (tm->tm_year > 0)
result = ((tm->tm_year + 99) / 100);
@@ -3333,7 +3359,7 @@ timestamp_part(PG_FUNCTION_ARGS)
* convert to timestamptz to produce consistent
* results
*/
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3353,7 +3379,7 @@ timestamp_part(PG_FUNCTION_ARGS)
break;
}
case DTK_DOW:
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3361,7 +3387,7 @@ timestamp_part(PG_FUNCTION_ARGS)
break;
case DTK_DOY:
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3424,7 +3450,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
if (type == UNITS)
{
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3548,14 +3574,14 @@ timestamptz_part(PG_FUNCTION_ARGS)
{
case DTK_EPOCH:
#ifdef HAVE_INT64_TIMESTAMP
- result = ((timestamp - SetEpochTimestamp()) / 1000000e0);
+ result = ((timestamp -SetEpochTimestamp()) /1000000e0);
#else
- result = timestamp - SetEpochTimestamp();
+ result = timestamp -SetEpochTimestamp();
#endif
break;
case DTK_DOW:
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3563,7 +3589,7 @@ timestamptz_part(PG_FUNCTION_ARGS)
break;
case DTK_DOY:
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3738,7 +3764,7 @@ Datum
timestamp_zone(PG_FUNCTION_ARGS)
{
text *zone = PG_GETARG_TEXT_P(0);
- Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
TimestampTz result;
int tz;
int type,
@@ -3780,7 +3806,7 @@ Datum
timestamp_izone(PG_FUNCTION_ARGS)
{
Interval *zone = PG_GETARG_INTERVAL_P(0);
- Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(1);
TimestampTz result;
int tz;
@@ -3811,7 +3837,7 @@ timestamp_izone(PG_FUNCTION_ARGS)
Datum
timestamp_timestamptz(PG_FUNCTION_ARGS)
{
- Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
+ Timestamp timestamp = PG_GETARG_TIMESTAMP(0);
PG_RETURN_TIMESTAMPTZ(timestamp2timestamptz(timestamp));
}
@@ -3827,9 +3853,10 @@ timestamp2timestamptz(Timestamp timestamp)
if (TIMESTAMP_NOT_FINITE(timestamp))
result = timestamp;
+
else
{
- if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) != 0)
+ if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
@@ -3861,9 +3888,10 @@ timestamptz_timestamp(PG_FUNCTION_ARGS)
if (TIMESTAMP_NOT_FINITE(timestamp))
result = timestamp;
+
else
{
- if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) != 0)
+ if (timestamp2tm(timestamp, &tz, tm, &fsec, &tzn) !=0)
ereport(ERROR,
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range")));
diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c
index e50427d2e3b..de88e86bbc3 100644
--- a/src/backend/utils/fmgr/fmgr.c
+++ b/src/backend/utils/fmgr/fmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.82 2004/08/29 04:12:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.83 2004/08/30 02:54:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,7 +79,7 @@ static void fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedur
static void fmgr_info_other_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple);
static CFuncHashTabEntry *lookup_C_func(HeapTuple procedureTuple);
static void record_C_func(HeapTuple procedureTuple,
- PGFunction user_fn, Pg_finfo_record *inforec);
+ PGFunction user_fn, Pg_finfo_record *inforec);
static Datum fmgr_oldstyle(PG_FUNCTION_ARGS);
static Datum fmgr_security_definer(PG_FUNCTION_ARGS);
@@ -244,8 +244,8 @@ fmgr_info_cxt_security(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt,
if (fbp == NULL)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
- errmsg("internal function \"%s\" is not in internal lookup table",
- prosrc)));
+ errmsg("internal function \"%s\" is not in internal lookup table",
+ prosrc)));
pfree(prosrc);
/* Should we check that nargs, strict, retset match the table? */
finfo->fn_addr = fbp->func;
@@ -300,7 +300,10 @@ fmgr_info_C_lang(Oid functionId, FmgrInfo *finfo, HeapTuple procedureTuple)
*probinstring;
void *libraryhandle;
- /* Get prosrc and probin strings (link symbol and library filename) */
+ /*
+ * Get prosrc and probin strings (link symbol and library
+ * filename)
+ */
prosrcattr = SysCacheGetAttr(PROCOID, procedureTuple,
Anum_pg_proc_prosrc, &isnull);
if (isnull)
@@ -470,7 +473,7 @@ fetch_finfo_record(void *filehandle, char *funcname)
static CFuncHashTabEntry *
lookup_C_func(HeapTuple procedureTuple)
{
- Oid fn_oid = HeapTupleGetOid(procedureTuple);
+ Oid fn_oid = HeapTupleGetOid(procedureTuple);
CFuncHashTabEntry *entry;
if (CFuncHash == NULL)
@@ -495,9 +498,9 @@ static void
record_C_func(HeapTuple procedureTuple,
PGFunction user_fn, Pg_finfo_record *inforec)
{
- Oid fn_oid = HeapTupleGetOid(procedureTuple);
+ Oid fn_oid = HeapTupleGetOid(procedureTuple);
CFuncHashTabEntry *entry;
- bool found;
+ bool found;
/* Create the hash table if it doesn't exist yet */
if (CFuncHash == NULL)
@@ -758,8 +761,8 @@ fmgr_oldstyle(PG_FUNCTION_ARGS)
*/
ereport(ERROR,
(errcode(ERRCODE_TOO_MANY_ARGUMENTS),
- errmsg("function %u has too many arguments (%d, maximum is %d)",
- fcinfo->flinfo->fn_oid, n_arguments, 16)));
+ errmsg("function %u has too many arguments (%d, maximum is %d)",
+ fcinfo->flinfo->fn_oid, n_arguments, 16)));
returnValue = NULL; /* keep compiler quiet */
break;
}
@@ -1622,8 +1625,8 @@ fmgr(Oid procedureId,...)
if (n_arguments > FUNC_MAX_ARGS)
ereport(ERROR,
(errcode(ERRCODE_TOO_MANY_ARGUMENTS),
- errmsg("function %u has too many arguments (%d, maximum is %d)",
- flinfo.fn_oid, n_arguments, FUNC_MAX_ARGS)));
+ errmsg("function %u has too many arguments (%d, maximum is %d)",
+ flinfo.fn_oid, n_arguments, FUNC_MAX_ARGS)));
va_start(pvar, procedureId);
for (i = 0; i < n_arguments; i++)
fcinfo.arg[i] = (Datum) va_arg(pvar, char *);
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
index 0dcf3e8a8cf..4bdbfe95635 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
@@ -7,7 +7,7 @@
*
* 1999/1/15 Tatsuo Ishii
*
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c,v 1.4 2003/11/29 22:40:08 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c,v 1.5 2004/08/30 02:54:40 momjian Exp $
*/
/* can be used in either frontend or backend */
@@ -19,7 +19,7 @@ typedef struct
{
unsigned short code,
peer;
-} codes_t;
+} codes_t;
/* map Big5 Level 1 to CNS 11643-1992 Plane 1 */
static codes_t big5Level1ToCnsPlane1[25] = { /* range */
@@ -205,7 +205,7 @@ static unsigned short b2c3[][2] = {
};
static unsigned short BinarySearchRange
- (codes_t * array, int high, unsigned short code)
+ (codes_t *array, int high, unsigned short code)
{
int low,
mid,
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
index a5af5426c10..24594355e27 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.9 2004/08/29 04:12:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.10 2004/08/30 02:54:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -65,7 +65,7 @@ typedef struct
pg_utf_to_local *map2; /* from UTF-8 map name */
int size1; /* size of map1 */
int size2; /* size of map2 */
-} pg_conv_map;
+} pg_conv_map;
static pg_conv_map maps[] = {
{PG_SQL_ASCII}, /* SQL/ASCII */
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index c7191baf4af..252d4a7f9ee 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.234 2004/08/29 05:06:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.235 2004/08/30 02:54:40 momjian Exp $
*
*--------------------------------------------------------------------
*/
@@ -3861,13 +3861,13 @@ flatten_set_variable_args(const char *name, List *args)
* Coerce to interval and back to normalize the value
* and account for any typmod.
*/
- Datum interval;
+ Datum interval;
char *intervalout;
interval =
- DirectFunctionCall3(interval_in,
- CStringGetDatum(val),
- ObjectIdGetDatum(InvalidOid),
+ DirectFunctionCall3(interval_in,
+ CStringGetDatum(val),
+ ObjectIdGetDatum(InvalidOid),
Int32GetDatum(arg->typename->typmod));
intervalout =
diff --git a/src/backend/utils/resowner/resowner.c b/src/backend/utils/resowner/resowner.c
index 181b9df11d5..4075e2c45ea 100644
--- a/src/backend/utils/resowner/resowner.c
+++ b/src/backend/utils/resowner/resowner.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/resowner/resowner.c,v 1.6 2004/08/29 05:06:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/resowner/resowner.c,v 1.7 2004/08/30 02:54:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,7 +157,7 @@ ResourceOwnerRelease(ResourceOwner owner,
save = CurrentResourceOwner;
PG_TRY();
- ResourceOwnerReleaseInternal(owner, phase, isCommit, isTopLevel);
+ ResourceOwnerReleaseInternal(owner, phase, isCommit, isTopLevel);
PG_CATCH();
{
CurrentResourceOwner = save;