Skip to content

Commit 093e0bc

Browse files
author
Raul Marin
committed
Always use @@plpythonu@@ as variable
1 parent ca1d5b0 commit 093e0bc

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_version.sql Makefile
150150
cat $(CDBSCRIPTS) | \
151151
$(SED) -e 's/@extschema@/cartodb/g' \
152152
-e 's/@postgisschema@/public/g' \
153-
-e 's/plpythonu/$(PLPYTHONU)/g' >> $@
153+
-e 's/@@plpythonu@@/$(PLPYTHONU)/g' >> $@
154154
echo "GRANT USAGE ON SCHEMA cartodb TO public;" >> $@
155155
cat cartodb_version.sql >> $@
156156

@@ -164,10 +164,10 @@ $(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: $(EXTENSION)--$(EXTVERSION).
164164
cp $< $@
165165

166166
$(EXTENSION).control: $(EXTENSION).control.in Makefile
167-
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/g' -e 's/plpythonu/$(PLPYTHONU)/g' $< > $@
167+
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/g' -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $< > $@
168168

169169
cartodb_version.sql: cartodb_version.sql.in Makefile $(GITDIR)/index
170-
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/' -e 's/@extschema@/cartodb/g' -e "s/@postgisschema@/public/g" -e 's/plpythonu/$(PLPYTHONU)/g' $< > $@
170+
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/' -e 's/@extschema@/cartodb/g' -e "s/@postgisschema@/public/g" -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $< > $@
171171

172172
# Needed for consistent `echo` results with backslashes
173173
SHELL = bash

cartodb.control.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ comment = 'Turn a database into a cartodb user database.'
33
superuser = true
44
relocatable = false
55
schema = cartodb
6-
requires = 'plpythonu, postgis'
6+
requires = '@@plpythonu@@, postgis'

scripts-available/CDB_FederatedServerDiagnostics.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ AS $$
191191
})
192192
return json.dumps(stats)
193193
$$
194-
LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE;
194+
LANGUAGE @@plpythonu@@ VOLATILE PARALLEL UNSAFE;
195195

196196

197197
--

scripts-available/CDB_GhostTables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ AS $$
4545
plpy.warning('Error calling Invalidation Service to link Ghost Tables: ' + str(err))
4646
break
4747
tis_retry -= 1 # try reconnecting
48-
$$ LANGUAGE 'plpythonu' VOLATILE PARALLEL UNSAFE;
48+
$$ LANGUAGE '@@plpythonu@@' VOLATILE PARALLEL UNSAFE;
4949

5050
-- Enqueues a job to run Ghost tables linking process for the current user
5151
CREATE OR REPLACE FUNCTION @[email protected]_LinkGhostTables(event_name text DEFAULT 'USER')

scripts-available/CDB_Groups_API.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $$
2121
body = '{ "name": "%s", "database_role": "%s" }' % (group_name, group_role)
2222
query = "select @extschema@._CDB_Group_API_Request('POST', '%s', '%s', '{200, 409}') as response_status" % (url, body)
2323
plpy.execute(query)
24-
$$ LANGUAGE 'plpythonu'
24+
$$ LANGUAGE '@@plpythonu@@'
2525
VOLATILE
2626
PARALLEL UNSAFE
2727
SECURITY DEFINER
@@ -41,7 +41,7 @@ $$
4141

4242
query = "select @extschema@._CDB_Group_API_Request('DELETE', '%s', '', '{204, 404}') as response_status" % url
4343
plpy.execute(query)
44-
$$ LANGUAGE 'plpythonu'
44+
$$ LANGUAGE '@@plpythonu@@'
4545
VOLATILE
4646
PARALLEL UNSAFE
4747
SECURITY DEFINER
@@ -61,7 +61,7 @@ $$
6161
body = '{ "name": "%s", "database_role": "%s" }' % (new_group_name, new_group_role)
6262
query = "select @extschema@._CDB_Group_API_Request('PUT', '%s', '%s', '{200, 409}') as response_status" % (url, body)
6363
plpy.execute(query)
64-
$$ LANGUAGE 'plpythonu'
64+
$$ LANGUAGE '@@plpythonu@@'
6565
VOLATILE
6666
PARALLEL UNSAFE
6767
SECURITY DEFINER
@@ -81,7 +81,7 @@ $$
8181
body = "{ \"users\": [\"%s\"] }" % "\",\"".join(usernames)
8282
query = "select @extschema@._CDB_Group_API_Request('POST', '%s', '%s', '{200, 409}') as response_status" % (url, body)
8383
plpy.execute(query)
84-
$$ LANGUAGE 'plpythonu'
84+
$$ LANGUAGE '@@plpythonu@@'
8585
VOLATILE
8686
PARALLEL UNSAFE
8787
SECURITY DEFINER
@@ -101,7 +101,7 @@ $$
101101
body = "{ \"users\": [\"%s\"] }" % "\",\"".join(usernames)
102102
query = "select @extschema@._CDB_Group_API_Request('DELETE', '%s', '%s', '{200, 404}') as response_status" % (url, body)
103103
plpy.execute(query)
104-
$$ LANGUAGE 'plpythonu'
104+
$$ LANGUAGE '@@plpythonu@@'
105105
VOLATILE
106106
PARALLEL UNSAFE
107107
SECURITY DEFINER
@@ -129,7 +129,7 @@ $$
129129
body = '{ "access": "%s" }' % access
130130
query = "select @extschema@._CDB_Group_API_Request('PUT', '%s', '%s', '{200, 409}') as response_status" % (url, body)
131131
plpy.execute(query)
132-
$$ LANGUAGE 'plpythonu'
132+
$$ LANGUAGE '@@plpythonu@@'
133133
VOLATILE
134134
PARALLEL UNSAFE
135135
SECURITY DEFINER
@@ -156,7 +156,7 @@ $$
156156
url = '/api/v1/databases/{0}/groups/%s/permission/%s/tables/%s' % (pathname2url(group_name), username, table_name)
157157
query = "select @extschema@._CDB_Group_API_Request('DELETE', '%s', '', '{200, 404}') as response_status" % url
158158
plpy.execute(query)
159-
$$ LANGUAGE 'plpythonu'
159+
$$ LANGUAGE '@@plpythonu@@'
160160
VOLATILE
161161
PARALLEL UNSAFE
162162
SECURITY DEFINER
@@ -191,15 +191,15 @@ $$
191191
params = json.loads(conf)
192192
auth = 'Basic %s' % plpy.execute("SELECT @extschema@._CDB_Group_API_Auth('%s', '%s') as auth" % (params['username'], params['password']))[0]['auth']
193193
return { "host": params['host'], "port": params['port'], 'timeout': params['timeout'], 'auth': auth }
194-
$$ LANGUAGE 'plpythonu' VOLATILE PARALLEL UNSAFE;
194+
$$ LANGUAGE '@@plpythonu@@' VOLATILE PARALLEL UNSAFE;
195195

196196
CREATE OR REPLACE
197197
FUNCTION @extschema@._CDB_Group_API_Auth(username text, password text)
198198
RETURNS TEXT AS
199199
$$
200200
import base64
201201
return base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
202-
$$ LANGUAGE 'plpythonu' VOLATILE PARALLEL UNSAFE;
202+
$$ LANGUAGE '@@plpythonu@@' VOLATILE PARALLEL UNSAFE;
203203

204204
-- url must contain a '%s' placeholder that will be replaced by current_database, for security reasons.
205205
CREATE OR REPLACE
@@ -239,5 +239,5 @@ $$
239239
raise last_err
240240

241241
return None
242-
$$ LANGUAGE 'plpythonu' VOLATILE PARALLEL UNSAFE;
242+
$$ LANGUAGE '@@plpythonu@@' VOLATILE PARALLEL UNSAFE;
243243
revoke all on function @extschema@._CDB_Group_API_Request(text, text, text, int[]) from public;

scripts-available/CDB_QueryStatements.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ RETURNS SETOF TEXT AS $$
1111
cleaned = match[0].strip()
1212
if ( cleaned ):
1313
yield cleaned
14-
$$ language 'plpythonu' IMMUTABLE STRICT PARALLEL SAFE;
14+
$$ language '@@plpythonu@@' IMMUTABLE STRICT PARALLEL SAFE;

0 commit comments

Comments
 (0)