mirror of
https://github.com/postgres/postgres.git
synced 2025-08-14 00:03:29 -04:00
Compare commits
No commits in common. "9b41d1d634aa9a3a36a21c5624b25c8475fd51ee" and "28a8cc457b022a68b01ae0c12fba73ad16764ec4" have entirely different histories.
9b41d1d634
...
28a8cc457b
@ -12704,29 +12704,8 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
|
|||||||
RememberConstraintForRebuilding(foundObject.objectId, tab);
|
RememberConstraintForRebuilding(foundObject.objectId, tab);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OCLASS_PROC:
|
|
||||||
|
|
||||||
/*
|
|
||||||
* A new-style SQL function can depend on a column, if that
|
|
||||||
* column is referenced in the parsed function body. Ideally
|
|
||||||
* we'd automatically update the function by deparsing and
|
|
||||||
* reparsing it, but that's risky and might well fail anyhow.
|
|
||||||
* FIXME someday.
|
|
||||||
*/
|
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
|
||||||
errmsg("cannot alter type of a column used by a function or procedure"),
|
|
||||||
errdetail("%s depends on column \"%s\"",
|
|
||||||
getObjectDescription(&foundObject, false),
|
|
||||||
colName)));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OCLASS_REWRITE:
|
case OCLASS_REWRITE:
|
||||||
|
/* XXX someday see if we can cope with revising views */
|
||||||
/*
|
|
||||||
* View/rule bodies have pretty much the same issues as
|
|
||||||
* function bodies. FIXME someday.
|
|
||||||
*/
|
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg("cannot alter type of a column used by a view or rule"),
|
errmsg("cannot alter type of a column used by a view or rule"),
|
||||||
@ -12742,9 +12721,9 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
|
|||||||
* specified as an update target, or because the column is
|
* specified as an update target, or because the column is
|
||||||
* used in the trigger's WHEN condition. The first case would
|
* used in the trigger's WHEN condition. The first case would
|
||||||
* not require any extra work, but the second case would
|
* not require any extra work, but the second case would
|
||||||
* require updating the WHEN expression, which has the same
|
* require updating the WHEN expression, which will take a
|
||||||
* issues as above. Since we can't easily tell which case
|
* significant amount of new code. Since we can't easily tell
|
||||||
* applies, we punt for both. FIXME someday.
|
* which case applies, we punt for both. FIXME someday.
|
||||||
*/
|
*/
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
@ -12816,6 +12795,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
|
|||||||
RememberStatisticsForRebuilding(foundObject.objectId, tab);
|
RememberStatisticsForRebuilding(foundObject.objectId, tab);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OCLASS_PROC:
|
||||||
case OCLASS_TYPE:
|
case OCLASS_TYPE:
|
||||||
case OCLASS_CAST:
|
case OCLASS_CAST:
|
||||||
case OCLASS_COLLATION:
|
case OCLASS_COLLATION:
|
||||||
|
@ -2915,10 +2915,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
|
|||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
||||||
errmsg("timestamp out of range")));
|
errmsg("timestamp out of range")));
|
||||||
|
|
||||||
if (pg_add_s32_overflow(tm->tm_mon, span->month, &tm->tm_mon))
|
tm->tm_mon += span->month;
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
if (tm->tm_mon > MONTHS_PER_YEAR)
|
if (tm->tm_mon > MONTHS_PER_YEAR)
|
||||||
{
|
{
|
||||||
tm->tm_year += (tm->tm_mon - 1) / MONTHS_PER_YEAR;
|
tm->tm_year += (tm->tm_mon - 1) / MONTHS_PER_YEAR;
|
||||||
@ -2970,10 +2967,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
|
|||||||
errmsg("timestamp out of range")));
|
errmsg("timestamp out of range")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pg_add_s64_overflow(timestamp, span->time, ×tamp))
|
timestamp += span->time;
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
|
|
||||||
if (!IS_VALID_TIMESTAMP(timestamp))
|
if (!IS_VALID_TIMESTAMP(timestamp))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -3035,10 +3029,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
|
|||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
||||||
errmsg("timestamp out of range")));
|
errmsg("timestamp out of range")));
|
||||||
|
|
||||||
if (pg_add_s32_overflow(tm->tm_mon, span->month, &tm->tm_mon))
|
tm->tm_mon += span->month;
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
if (tm->tm_mon > MONTHS_PER_YEAR)
|
if (tm->tm_mon > MONTHS_PER_YEAR)
|
||||||
{
|
{
|
||||||
tm->tm_year += (tm->tm_mon - 1) / MONTHS_PER_YEAR;
|
tm->tm_year += (tm->tm_mon - 1) / MONTHS_PER_YEAR;
|
||||||
@ -3097,10 +3088,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
|
|||||||
errmsg("timestamp out of range")));
|
errmsg("timestamp out of range")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pg_add_s64_overflow(timestamp, span->time, ×tamp))
|
timestamp += span->time;
|
||||||
ereport(ERROR,
|
|
||||||
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
|
|
||||||
errmsg("timestamp out of range")));
|
|
||||||
|
|
||||||
if (!IS_VALID_TIMESTAMP(timestamp))
|
if (!IS_VALID_TIMESTAMP(timestamp))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -375,8 +375,6 @@ SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days'
|
|||||||
|
|
||||||
SELECT timestamp without time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
SELECT timestamp without time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
||||||
ERROR: timestamp out of range
|
ERROR: timestamp out of range
|
||||||
SELECT timestamp without time zone '294276-12-31 23:59:59' + interval '9223372036854775807 microseconds' AS "out of range";
|
|
||||||
ERROR: timestamp out of range
|
|
||||||
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
|
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
|
||||||
106751991 Days
|
106751991 Days
|
||||||
------------------
|
------------------
|
||||||
@ -639,8 +637,6 @@ SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS
|
|||||||
|
|
||||||
SELECT timestamp with time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
SELECT timestamp with time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
||||||
ERROR: timestamp out of range
|
ERROR: timestamp out of range
|
||||||
SELECT timestamp with time zone '294276-12-31 23:59:59 UTC' + interval '9223372036854775807 microseconds' AS "out of range";
|
|
||||||
ERROR: timestamp out of range
|
|
||||||
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
|
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
|
||||||
True
|
True
|
||||||
------
|
------
|
||||||
|
@ -87,7 +87,6 @@ SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days'
|
|||||||
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
|
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
|
||||||
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
|
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
|
||||||
SELECT timestamp without time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
SELECT timestamp without time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
||||||
SELECT timestamp without time zone '294276-12-31 23:59:59' + interval '9223372036854775807 microseconds' AS "out of range";
|
|
||||||
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
|
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
|
||||||
|
|
||||||
-- Shorthand values
|
-- Shorthand values
|
||||||
@ -120,7 +119,6 @@ SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
|
|||||||
SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
|
SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
|
||||||
SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
|
SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
|
||||||
SELECT timestamp with time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
SELECT timestamp with time zone '2000-01-01' - interval '2483590 days' AS "out of range";
|
||||||
SELECT timestamp with time zone '294276-12-31 23:59:59 UTC' + interval '9223372036854775807 microseconds' AS "out of range";
|
|
||||||
|
|
||||||
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
|
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
|
||||||
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
|
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user