rrs-commit: r55 - trunk

decibel at decibel.org decibel at decibel.org
Sat Mar 26 22:10:41 GMT 2005


Author: decibel
Date: Sat Mar 26 22:10:39 2005
New Revision: 55

Modified:
   trunk/rrs_functions.sql
Log:
Formatting and re-ordering

Modified: trunk/rrs_functions.sql
==============================================================================
--- trunk/rrs_functions.sql	(original)
+++ trunk/rrs_functions.sql	Sat Mar 26 22:10:39 2005
@@ -160,10 +160,13 @@
     SECURITY DEFINER
 ;
 
---
--- TOC entry 17 (OID 591228975)
--- Name: max_end_time_to_delete(integer); Type: FUNCTION; Schema: rrs; Owner: pgsql
---
+
+
+
+
+
+
+
 
 CREATE OR REPLACE FUNCTION max_end_time_to_delete(integer) RETURNS timestamp with time zone
     AS '
@@ -224,10 +227,10 @@
     LANGUAGE plpgsql;
 
 
---
--- TOC entry 18 (OID 591228976)
--- Name: update_buckets(); Type: FUNCTION; Schema: rrs; Owner: pgsql
---
+
+
+
+
 
 CREATE OR REPLACE FUNCTION update_buckets( history_data_interval.start_time%TYPE ) RETURNS integer
     AS '
@@ -386,6 +389,14 @@
 '
     LANGUAGE plpgsql;
 
+
+
+
+
+
+
+
+
 CREATE OR REPLACE FUNCTION calculate_end_time ( rrs.bucket.end_time%TYPE, rrs.history.start_time%TYPE ) RETURNS timestamp with time zone AS '
 DECLARE
     p_first_end_time ALIAS FOR $1;
@@ -484,27 +495,11 @@
 END;
 ' LANGUAGE plpgsql;
 
-CREATE OR REPLACE FUNCTION interval_to_seconds(interval) RETURNS double precision AS '
-    SELECT extract( EPOCH FROM $1 );
-' LANGUAGE sql IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION seconds_to_interval(double precision) RETURNS interval AS '
-    SELECT ( $1::text || '' seconds'' )::interval(6);
-' LANGUAGE sql IMMUTABLE STRICT;
 
-CREATE OR REPLACE FUNCTION interval_time(timestamp with time zone, interval) RETURNS timestamp with time zone
-    AS '
-SELECT ''1970-01-01 GMT''::timestamp with time zone + rrs.seconds_to_interval(
-            floor( extract( EPOCH FROM $1 ) / rrs.interval_to_seconds($2) ) * rrs.interval_to_seconds($2)::int
-        ) ;
-'
-    LANGUAGE sql IMMUTABLE STRICT;
 
 
---
--- TOC entry 20 (OID 591228978)
--- Name: add_buckets(integer, interval, timestamp with time zone, timestamp with time zone); Type: FUNCTION; Schema: rrs; Owner: pgsql
---
+
 
 CREATE OR REPLACE FUNCTION add_buckets(integer, interval, timestamp with time zone, timestamp with time zone) RETURNS integer
     AS '
@@ -642,6 +637,12 @@
 ;
 
 
+
+
+
+
+
+
 CREATE OR REPLACE FUNCTION setting_get(text) RETURNS text AS '
     SELECT setting FROM rrs.setting WHERE setting_name = $1;
 '
@@ -689,6 +690,28 @@
     LANGUAGE plpgsql
     SECURITY DEFINER
 ;
+
+
+
+
+
+
+
+CREATE OR REPLACE FUNCTION interval_to_seconds(interval) RETURNS double precision AS '
+    SELECT extract( EPOCH FROM $1 );
+' LANGUAGE sql IMMUTABLE STRICT;
+
+CREATE OR REPLACE FUNCTION seconds_to_interval(double precision) RETURNS interval AS '
+    SELECT ( $1::text || '' seconds'' )::interval(6);
+' LANGUAGE sql IMMUTABLE STRICT;
+
+CREATE OR REPLACE FUNCTION interval_time(timestamp with time zone, interval) RETURNS timestamp with time zone
+    AS '
+SELECT ''1970-01-01 GMT''::timestamp with time zone + rrs.seconds_to_interval(
+            floor( extract( EPOCH FROM $1 ) / rrs.interval_to_seconds($2) ) * rrs.interval_to_seconds($2)::int
+        ) ;
+'
+    LANGUAGE sql IMMUTABLE STRICT;
 
 CREATE OR REPLACE FUNCTION tod() RETURNS timestamptz AS '
     SELECT timeofday()::timestamptz


More information about the rrs-commit mailing list