2016-11-24 20:27:32 +08:00
|
|
|
CREATE OR REPLACE FUNCTION <%= DATASERVICES_CLIENT_SCHEMA %>._<%= name %> (<%= ['username text', 'organization_name text'].concat(params_with_type_and_default).join(', ') %>)
|
2015-11-19 22:44:51 +08:00
|
|
|
RETURNS <%= return_type %> AS $$
|
2016-02-06 00:57:56 +08:00
|
|
|
CONNECT <%= DATASERVICES_CLIENT_SCHEMA %>._server_conn_str();
|
2016-02-24 23:58:14 +08:00
|
|
|
<% if multi_field %>
|
2016-11-24 20:27:32 +08:00
|
|
|
SELECT * FROM <%= DATASERVICES_SERVER_SCHEMA %>.<%= name %> (<%= ['username', 'organization_name'].concat(params).join(', ') %>);
|
2016-02-11 18:10:12 +08:00
|
|
|
<% else %>
|
2016-11-24 20:27:32 +08:00
|
|
|
SELECT <%= DATASERVICES_SERVER_SCHEMA %>.<%= name %> (<%= ['username', 'organization_name'].concat(params).join(', ') %>);
|
2016-02-11 18:10:12 +08:00
|
|
|
<% end %>
|
2015-11-18 22:14:08 +08:00
|
|
|
$$ LANGUAGE plproxy;
|