User Documentation
utilities.sql_in File Reference

SQL functions for carrying out routine tasks. More...

Go to the source code of this file.

Functions

text version ()
 Return MADlib build information.
void assert (boolean condition, varchar msg)
 Raise an exception if the given condition is not satisfied.
float8 relative_error (float8 approx, float8 value)
 Compute the relative error of an approximate value.
float8 relative_error (float8[] approx, float8[] value)
 Compute the relative error (w.r.t. the 2-norm) of an apprixmate vector.
boolean check_if_raises_error (text sql)
 Check if a SQL statement raises an error.
boolean isnan (float8 number)
 Check if a floating-point number is NaN (not a number)
void create_schema_pg_temp ()
 Create the temporary schema if it does not exist yet.
void noop ()
 Create volatile noop function.
varchar __unique_string ()
 Generate random remporary names for temp table and other names.
text bool_to_text (boolean)
 Cast boolean into text.

Detailed Description

See also:
For a brief overview of utility functions, see the module description DB Administrator Utilities.

Definition in file utilities.sql_in.


Function Documentation

boolean check_if_raises_error ( text  sql)
Parameters:
sqlThe SQL statement
Returns:
TRUE if an exception is raised while executing sql, FALSE otherwise.

Definition at line 123 of file utilities.sql_in.

boolean isnan ( float8  number)

This function exists for portability. Some DBMSs like PostgreSQL treat floating-point numbers as fully ordered -- contrary to IEEE 754. (See, e.g., the PostgreSQL documentation. For portability, MADlib code should not make use of such "features" directly, but only use isnan() instead.

Parameters:
number
Returns:
TRUE if number is NaN, FALSE otherwise

Definition at line 152 of file utilities.sql_in.

void noop ( )

The only use of this function is as an optimization fence when used in the SELECT list of a query. See, e.g., http://archives.postgresql.org/pgsql-sql/2012-07/msg00030.php

Definition at line 191 of file utilities.sql_in.

text version ( )
Returns:
Summary of MADlib build information, consisting of MADlib version, git revision, cmake configuration time, build type, build system, C compiler, and C++ compiler

Definition at line 55 of file utilities.sql_in.