Skip to content

Commit 243a913

Browse files
author
Thomas G. Lockhart
committed
Remove some definitions which could not work; conversions from datetime
to integer unix system time conflict on the input types. Leave in the conversions from integer unix system time to datetime.
1 parent 9d99dac commit 243a913

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

contrib/unixdate/unixdate.sql

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-- unixdate
22
-- Routines to convert int4 (Unix system time) to datetime
3-
-- and int4 (delta time) to timespan
3+
-- and int4 (delta time in seconds) to timespan
44
--
55
-- Thomas Lockhart (lockhart@alumni.caltech.edu)
66
-- 1997-11-25
77
--
88
-- This cheats and reuses existing code in the standard package.
99
-- Can not include this directly because built-in functions are optimized
1010
-- into a cache and the duplicate function names abstime_datetime() and
11-
-- reltime_timespan() result in duplicate constants.
11+
-- reltime_timespan() would result in duplicate constants.
1212
--
1313
-- This works with Postgres v6.2 and higher.
1414

@@ -32,23 +32,3 @@ CREATE FUNCTION timespan(int4)
3232
RETURNS timespan
3333
AS 'select reltime_timespan($1)' LANGUAGE 'SQL';
3434

35-
--
36-
-- Conversions back to integer
37-
--
38-
39-
CREATE FUNCTION datetime_abstime(datetime)
40-
RETURNS int4
41-
AS '-' LANGUAGE 'internal';
42-
43-
CREATE FUNCTION utime(datetime)
44-
RETURNS int4
45-
AS 'select datetime_abstime($1)' LANGUAGE 'SQL';
46-
47-
CREATE FUNCTION timespan_reltime(timespan)
48-
RETURNS int4
49-
AS '-' LANGUAGE 'internal';
50-
51-
CREATE FUNCTION uspan(timespan)
52-
RETURNS int4
53-
AS 'select timespan_reltime($1)' LANGUAGE 'SQL';
54-

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy