From 8338cc03a8915e28024981d09193612ec4a83819 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 3 May 2002 04:11:08 +0000 Subject: [PATCH] Remove the last traces of datatypes datetime and timespan. --- contrib/oracle/Ora2Pg.pm | 4 ++-- contrib/spi/moddatetime.example | 2 +- contrib/spi/refint.c | 2 +- contrib/spi/timetravel.example | 2 +- contrib/tips/README.apachelog | 2 +- doc/src/sgml/datatype.sgml | 18 ++---------------- doc/src/sgml/plsql.sgml | 4 ++-- doc/src/sgml/release.sgml | 3 ++- src/backend/catalog/heap.c | 4 ++-- src/interfaces/python/pgdb.py | 2 +- 10 files changed, 15 insertions(+), 28 deletions(-) diff --git a/contrib/oracle/Ora2Pg.pm b/contrib/oracle/Ora2Pg.pm index fa42430c32..e2dabfc75b 100644 --- a/contrib/oracle/Ora2Pg.pm +++ b/contrib/oracle/Ora2Pg.pm @@ -1290,8 +1290,8 @@ sub _sql_type 'VARCHAR2' => 'varchar', 'NVARCHAR2' => 'varchar', # The DATE data type is used to store the date and time information. - # Pg type datetime should match all needs - 'DATE' => 'datetime', + # Pg type timestamp should match all needs + 'DATE' => 'timestamp', # Type LONG is like VARCHAR2 but with up to 2Gb. # PG type text should match all needs or if you want you could use blob 'LONG' => 'text', # Character data of variable length diff --git a/contrib/spi/moddatetime.example b/contrib/spi/moddatetime.example index 25a54e3a33..e4a713c12a 100644 --- a/contrib/spi/moddatetime.example +++ b/contrib/spi/moddatetime.example @@ -3,7 +3,7 @@ DROP TABLE mdt; CREATE TABLE mdt ( id int4, idesc text, - moddate datetime DEFAULT datetime(CURRENT_TIMESTAMP) NOT NULL + moddate timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL ); CREATE TRIGGER mdt_moddatetime diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index 82a07871fb..55c0fd13e6 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -450,7 +450,7 @@ check_foreign_key(PG_FUNCTION_ARGS) if ((strcmp(type, "text") && strcmp(type, "varchar") && strcmp(type, "char") && strcmp(type, "bpchar") && - strcmp(type, "date") && strcmp(type, "datetime")) == 0) + strcmp(type, "date") && strcmp(type, "timestamp")) == 0) is_char_type = 1; #ifdef DEBUG_QUERY elog(DEBUG3, "Check_foreign_key Debug value %s type %s %d", diff --git a/contrib/spi/timetravel.example b/contrib/spi/timetravel.example index fa76c25017..4244bed19f 100644 --- a/contrib/spi/timetravel.example +++ b/contrib/spi/timetravel.example @@ -18,7 +18,7 @@ insert into tttest(price_id, price_val) values (2, 2); insert into tttest(price_id, price_val,price_off) values (3, 3, 'infinity'); insert into tttest(price_id, price_val,price_off) values (3, 3, - datetime_abstime(datetime_mi_span('now', '100'))); + abstime('now'::timestamp - '100 days'::interval)); insert into tttest(price_id, price_val,price_on) values (3, 3, 'infinity'); select * from tttest; diff --git a/contrib/tips/README.apachelog b/contrib/tips/README.apachelog index 8e9096241e..964c6ec1a3 100644 --- a/contrib/tips/README.apachelog +++ b/contrib/tips/README.apachelog @@ -69,7 +69,7 @@ not as a finished idea. --- apachelog.sql : --- drop table access; -CREATE TABLE access (host char(200), ident char(200), authuser char(200), accdate datetime, request char(500), ttime int2, status int2, bytes int4) archive = none; +CREATE TABLE access (host char(200), ident char(200), authuser char(200), accdate timestamp, request char(500), ttime int2, status int2, bytes int4) archive = none; grant all on access to nobody; --- httpconf.txt: --- diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 45a13a5d30..75ab4b8864 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1340,24 +1340,10 @@ SELECT b, char_length(b) FROM test2; outside that range are in UTC. - - To ensure an upgrade path from versions of - PostgreSQL earlier than 7.0, - we recognize datetime - (equivalent to timestamp) and - timespan (equivalent to interval). - These types are - now restricted to having an - implicit translation to timestamp and - interval, and - support for these will be removed in the next release of - PostgreSQL (likely named 7.3). - - The types abstime and reltime are lower precision types which are used internally. - You are discouraged from using any of these types in new + You are discouraged from using these types in new applications and are encouraged to move any old ones over when appropriate. Any or all of these internal types might disappear in a future release. diff --git a/doc/src/sgml/plsql.sgml b/doc/src/sgml/plsql.sgml index aa643a26b2..b360e91f5c 100644 --- a/doc/src/sgml/plsql.sgml +++ b/doc/src/sgml/plsql.sgml @@ -1,5 +1,5 @@ @@ -2744,7 +2744,7 @@ show errors package would become something like this: -CREATE FUNCTION acs__add_user(INTEGER,INTEGER,VARCHAR,DATETIME,INTEGER,INTEGER,...) +CREATE FUNCTION acs__add_user(INTEGER,INTEGER,VARCHAR,TIMESTAMP,INTEGER,INTEGER,...) RETURNS INTEGER AS ' DECLARE user_id ALIAS FOR $1; diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml index 0fe78be994..72157ff271 100644 --- a/doc/src/sgml/release.sgml +++ b/doc/src/sgml/release.sgml @@ -1,5 +1,5 @@ @@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without worries about funny characters. -->