Fixes to be able to install the extension

This commit is contained in:
Rafa de la Torre 2016-06-23 18:22:11 +02:00 committed by Carla Iriberri
parent d517c62e6f
commit 4b72af34ec

View File

@ -1,40 +1,20 @@
CREATE TYPE cdb_dataservices_server.ds_fdw_metadata as (schemaname text, tabname text, servername text);
CREATE TYPE cdb_dataservices_server.ds_return_metadata as (colnames text[], coltypes text[]);
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_ConnectUserTable(username text, useruuid text, input_schema text, dbname text, table_name text)
RETURNS ds_fdw_metadata AS $$
---- quota/checks and internal call to function
--TODO: need username and orgname
# TODO: need username and orgname
return plpy.execute("SELECT * FROM _OBS_ConnectUserTable('{0}'::text, '{1}'::text, '{2}'::text, '{3}'::text, '{4}'::text)"
.format(username, useruuid, input_schema, dbname, table_name))
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetReturnMetadata(params json)
RETURNS ds_return_metadata AS $$
---- quota/checks and internal call to function
--TODO: need username and orgname
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetAugmentedColumns(table_schema text, table_name text, params json)
RETURNS SETOF record AS $$
---- quota/checks and internal call to function
--TODO: need username and orgname
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_DisconnectUserTable(table_schema text, table_name text, servername text)
RETURNS boolean AS $$
---- quota/checks and internal call to function
--TODO: need username and orgname
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_ConnectUserTable(username text, useruuid text, input_schema text, dbname text, table_name text)
RETURNS ds_fdw_metadata AS $$
CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname);
SELECT cdb_observatory._OBS_ConnectUserTable(username text, useruuid text, input_schema text, dbname text, host text, table_name text);
$$ LANGUAGE plproxy;
CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_GetReturnMetadata(params json)
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetReturnMetadata(params json)
RETURNS ds_return_metadata AS $$
CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname);
SELECT cdb_observatory._OBS_GetReturnMetadata(params json);
@ -43,11 +23,11 @@ $$ LANGUAGE plproxy;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_GetProcessedData(table_schema text, table_name text, params json)
RETURNS SETOF record AS $$
CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname);
SELECT cdb_observatory._OBS_GetReturnMetadata(params json);
TARGET cdb_observatory.OBS_GetProcessedData;
$$ LANGUAGE plproxy;
CREATE OR REPLACE FUNCTION cdb_dataservices_server._OBS_DisconnectUserTable(table_schema text, table_name text, servername text)
CREATE OR REPLACE FUNCTION cdb_dataservices_server.OBS_DisconnectUserTable(table_schema text, table_name text, servername text)
RETURNS boolean AS $$
CONNECT cdb_dataservices_server._obs_server_conn_str(username, orgname);
SELECT cdb_observatory._OBS_DisconnectUserTable(table_schema text, table_name text, servername text);