Remove the last traces of datatypes datetime and timespan.
authorTom Lane <[email protected]>
Fri, 3 May 2002 04:11:08 +0000 (04:11 +0000)
committerTom Lane <[email protected]>
Fri, 3 May 2002 04:11:08 +0000 (04:11 +0000)
contrib/oracle/Ora2Pg.pm
contrib/spi/moddatetime.example
contrib/spi/refint.c
contrib/spi/timetravel.example
contrib/tips/README.apachelog
doc/src/sgml/datatype.sgml
doc/src/sgml/plsql.sgml
doc/src/sgml/release.sgml
src/backend/catalog/heap.c
src/interfaces/python/pgdb.py

index fa42430c32f89800c0a1928b00ba73f2e273caec..e2dabfc75b8496a676ac4fff4d78f93b4c7af682 100644 (file)
@@ -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
index 25a54e3a335c4cfe823548e5155f58b0f4ae0fa3..e4a713c12a1146e320c3f7d0153c88aea267c29d 100644 (file)
@@ -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
index 82a07871fb8fbf7ec08f3b289543ff98bcc34a91..55c0fd13e6802a239ad8685278ae60e15180a96e 100644 (file)
@@ -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",
index fa76c25017658e87aa4b0599e8f5a192f01bc9f5..4244bed19f5a8ad809e4ba1735db19ac63a6d1c8 100644 (file)
@@ -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;
index 8e9096241ea04d8240b607f57899a5797dcab932..964c6ec1a3af1423d82294924747548e122e11f3 100644 (file)
@@ -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: ---
index 4b96cb5f8a374481dc832375830a7d00beb5f18d..9a817c17e3b12364c0b974d56461d9a855da0cd5 100644 (file)
@@ -1340,24 +1340,10 @@ SELECT b, char_length(b) FROM test2;
     outside that range are in <acronym>UTC</acronym>.
    </para>
 
-   <para>
-    To ensure an upgrade path from versions of
-    <productname>PostgreSQL</productname> earlier than 7.0,
-    we recognize <type>datetime</type>
-    (equivalent to <type>timestamp</type>) and
-    <type>timespan</type> (equivalent to <type>interval</type>).
-    These types are
-    now restricted to having an
-    implicit translation to <type>timestamp</type> and
-    <type>interval</type>, and 
-    support for these will be removed in the next release of
-    <productname>PostgreSQL</productname> (likely named 7.3).
-   </para>
-
    <para>
     The types <type>abstime</type>
     and <type>reltime</type> 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.
index 9f1d7e0ea9841409cc9caab07391736b0110f7be..f941a35a2645633839ed5bc359f116a1d7f84820 100644 (file)
@@ -2744,7 +2744,7 @@ show errors
     package would become something like this:
  
 <programlisting>
-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;
index cdcdbd34c5e614e4dd311994852ac60df0d2d881..aaa391d6b02fedae9b9fc2b57af47ee2dfd15b65 100644 (file)
@@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without
 worries about funny characters.
 -->
 <literallayout><![CDATA[
+The last vestiges of support for type names datetime and timespan are gone; use timestamp and interval instead
 Rule names are now per-relation, not global; DROP RULE and COMMENT ON RULE syntax changes accordingly
 Readline and Zlib are now required by default and must be turned off explicitly if their use is not desired
 Define a third class of function volatility to allow indexscans in more cases
index b790c010f070075a774b8f0bb757825f4f080f6a..65b48879048a4edb003d591faab7bc9dee887cc9 100644 (file)
@@ -1777,7 +1777,7 @@ cookDefault(ParseState *pstate,
         * column's type.  We store the expression without coercion,
         * however, to avoid premature coercion in cases like
         *
-        * CREATE TABLE tbl (fld datetime DEFAULT 'now'::text);
+        * CREATE TABLE tbl (fld timestamp DEFAULT 'now'::text);
         *
         * NB: this should match the code in optimizer/prep/preptlist.c that
         * will actually do the coercion, to ensure we don't accept an
index c9a8e47b895edb7d26b085c191723d60389713c6..7c6b89dfc3031d2f515daf17e7a4c794614f8f2a 100644 (file)
@@ -415,7 +415,7 @@ MONEY = pgdbType('money')
 
 # this may be problematic as type are quite different ... I hope it won't hurt
 DATETIME = pgdbType(
-       'abstime', 'reltime', 'tinterval', 'date', 'time', 'timespan', 'timestamp'
+       'abstime', 'reltime', 'tinterval', 'date', 'time', 'timespan', 'timestamp', 'timestamptz', 'interval'
 )
 
 # OIDs are used for everything (types, tables, BLOBs, rows, ...). This may cause