-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow installation in alternate schema w/o search_path hacking. Closes …
- Loading branch information
Showing
3 changed files
with
72 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,32 +63,32 @@ CREATE OR REPLACE FUNCTION http(request http_request) | |
|
||
CREATE OR REPLACE FUNCTION http_get(uri VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('GET', $1, NULL, NULL, NULL)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('GET', $1, NULL, NULL, NULL)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_post(uri VARCHAR, content VARCHAR, content_type VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('POST', $1, NULL, $3, $2)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('POST', $1, NULL, $3, $2)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_put(uri VARCHAR, content VARCHAR, content_type VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('PUT', $1, NULL, $3, $2)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('PUT', $1, NULL, $3, $2)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_patch(uri VARCHAR, content VARCHAR, content_type VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('PATCH', $1, NULL, $3, $2)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('PATCH', $1, NULL, $3, $2)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_delete(uri VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('DELETE', $1, NULL, NULL, NULL)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('DELETE', $1, NULL, NULL, NULL)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_head(uri VARCHAR) | ||
RETURNS http_response | ||
AS $$ SELECT http(('HEAD', $1, NULL, NULL, NULL)::http_request) $$ | ||
AS $$ SELECT @extschema@.http(('HEAD', $1, NULL, NULL, NULL)::@extschema@.http_request) $$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION urlencode(string VARCHAR) | ||
|
@@ -111,12 +111,16 @@ CREATE OR REPLACE FUNCTION urlencode(data JSONB) | |
|
||
CREATE OR REPLACE FUNCTION http_get(uri VARCHAR, data JSONB) | ||
RETURNS http_response | ||
AS $$ SELECT http(('GET', $1 || '?' || urlencode($2), NULL, NULL, NULL)::http_request) $$ | ||
AS $$ | ||
SELECT @[email protected](('GET', $1 || '?' || urlencode($2), NULL, NULL, NULL)::@[email protected]_request) | ||
$$ | ||
LANGUAGE 'sql'; | ||
|
||
CREATE OR REPLACE FUNCTION http_post(uri VARCHAR, data JSONB) | ||
RETURNS http_response | ||
AS $$ SELECT http(('POST', $1, NULL, 'application/x-www-form-urlencoded', urlencode($2))::http_request) $$ | ||
AS $$ | ||
SELECT @[email protected](('POST', $1, NULL, 'application/x-www-form-urlencoded', urlencode($2))::@[email protected]_request) | ||
$$ | ||
LANGUAGE 'sql'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
default_version = '1.4' | ||
module_pathname = '$libdir/http' | ||
relocatable = true | ||
comment = 'HTTP client for PostgreSQL, allows web page retrieval inside the database.' |