diff options
Diffstat (limited to 'contrib/cube')
| -rw-r--r-- | contrib/cube/README.cube | 4 | ||||
| -rw-r--r-- | contrib/cube/cube.c | 14 | ||||
| -rw-r--r-- | contrib/cube/cube.sql.in | 10 | ||||
| -rw-r--r-- | contrib/cube/expected/cube.out | 2 | ||||
| -rw-r--r-- | contrib/cube/expected/cube_1.out | 2 | ||||
| -rw-r--r-- | contrib/cube/expected/cube_2.out | 2 | ||||
| -rw-r--r-- | contrib/cube/sql/cube.sql | 2 | ||||
| -rw-r--r-- | contrib/cube/uninstall_cube.sql | 4 |
8 files changed, 5 insertions, 35 deletions
diff --git a/contrib/cube/README.cube b/contrib/cube/README.cube index e83763f68e0..56b06202dc3 100644 --- a/contrib/cube/README.cube +++ b/contrib/cube/README.cube @@ -236,10 +236,6 @@ cube_distance(cube, cube) returns double cube_distance returns the distance between two cubes. If both cubes are points, this is the normal distance function. -cube(text) returns cube - cube takes text input and returns a cube. This is useful for making cubes - from computed strings. - cube(float8) returns cube This makes a one dimensional cube with both coordinates the same. If the type of the argument is a numeric type other than float8 an diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index f58af9ef678..ec8cb72e3b7 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -1,5 +1,5 @@ /****************************************************************************** - $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.32 2007/03/07 21:21:11 teodor Exp $ + $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.33 2007/06/05 21:31:03 tgl Exp $ This file contains routines that can be bound to a Postgres backend and called by the backend in the process of processing queries. The calling @@ -173,18 +173,6 @@ cube_in(PG_FUNCTION_ARGS) PG_RETURN_NDBOX(result); } -/* Allow conversion from text to cube to allow input of computed strings */ -/* There may be issues with toasted data here. I don't know enough to be sure.*/ -Datum -cube(PG_FUNCTION_ARGS) -{ - char *cstring; - - cstring = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(0)))); - - PG_RETURN_DATUM(DirectFunctionCall1(cube_in, PointerGetDatum(cstring))); -} - /* ** Allows the construction of a cube from 2 float[]'s diff --git a/contrib/cube/cube.sql.in b/contrib/cube/cube.sql.in index c1697b0ea97..2e548128025 100644 --- a/contrib/cube/cube.sql.in +++ b/contrib/cube/cube.sql.in @@ -31,16 +31,6 @@ CREATE TYPE cube ( COMMENT ON TYPE cube IS 'multi-dimensional cube ''(FLOAT-1, FLOAT-2, ..., FLOAT-N), (FLOAT-1, FLOAT-2, ..., FLOAT-N)'''; --- Convert from text to cube - -CREATE OR REPLACE FUNCTION cube(text) RETURNS cube -AS 'MODULE_PATHNAME' -LANGUAGE C IMMUTABLE STRICT; - -COMMENT ON FUNCTION cube(text) IS 'convert text to cube'; - -CREATE CAST (text AS cube) WITH FUNCTION cube(text) AS ASSIGNMENT; - -- -- External C-functions for R-tree methods -- diff --git a/contrib/cube/expected/cube.out b/contrib/cube/expected/cube.out index 4f643573b51..86b33483a54 100644 --- a/contrib/cube/expected/cube.out +++ b/contrib/cube/expected/cube.out @@ -826,7 +826,7 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); -- Test of cube function (text to cube) -- -SELECT cube('('||1||','||1.2||')'); +SELECT cube('(1,1.2)'::text); cube ---------- (1, 1.2) diff --git a/contrib/cube/expected/cube_1.out b/contrib/cube/expected/cube_1.out index 49e6c3fa31d..8609c261062 100644 --- a/contrib/cube/expected/cube_1.out +++ b/contrib/cube/expected/cube_1.out @@ -826,7 +826,7 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); -- Test of cube function (text to cube) -- -SELECT cube('('||1||','||1.2||')'); +SELECT cube('(1,1.2)'::text); cube ---------- (1, 1.2) diff --git a/contrib/cube/expected/cube_2.out b/contrib/cube/expected/cube_2.out index ff6dbc4e5c7..d8737c3cb38 100644 --- a/contrib/cube/expected/cube_2.out +++ b/contrib/cube/expected/cube_2.out @@ -826,7 +826,7 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); -- Test of cube function (text to cube) -- -SELECT cube('('||1||','||1.2||')'); +SELECT cube('(1,1.2)'::text); cube ---------- (1, 1.2) diff --git a/contrib/cube/sql/cube.sql b/contrib/cube/sql/cube.sql index 49d9869c533..1931dfbc803 100644 --- a/contrib/cube/sql/cube.sql +++ b/contrib/cube/sql/cube.sql @@ -223,7 +223,7 @@ SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); -- Test of cube function (text to cube) -- -SELECT cube('('||1||','||1.2||')'); +SELECT cube('(1,1.2)'::text); SELECT cube(NULL); -- Test of cube_dim function (dimensions stored in cube) diff --git a/contrib/cube/uninstall_cube.sql b/contrib/cube/uninstall_cube.sql index 784138acd58..2c5c1645652 100644 --- a/contrib/cube/uninstall_cube.sql +++ b/contrib/cube/uninstall_cube.sql @@ -92,8 +92,4 @@ DROP FUNCTION cube_ne(cube, cube); DROP FUNCTION cube_eq(cube, cube); -DROP CAST (text AS cube); - -DROP FUNCTION cube(text); - DROP TYPE cube CASCADE; |
