Commit Graph

580 Commits

Author SHA1 Message Date
Guido Fioravantti
453b3af872 Removes extra d in delimiter 155 2015-10-30 17:49:27 +01:00
Guido Fioravantti
fdfbe8e62c Typo fixing 173 2015-10-27 12:11:00 +01:00
Guido Fioravantti
32c729e464 Refactors code 173 2015-10-27 10:33:15 +01:00
Guido Fioravantti
58b2705383 Rename relname to colname in _CDB_Unique_Column_Identifier 2015-10-26 18:35:12 +01:00
Guido Fioravantti
8734608792 Removes unnecessary salt 173 2015-10-26 18:25:48 +01:00
Guido Fioravantti
bb54eb83c1 Drops CDB_Trim_Octets for CDB_Octet_Truncate 2015-10-26 18:01:03 +01:00
Guido Fioravantti
2e701f73ba Reworks _CDB_Octet_Trim 173 2015-10-26 16:35:33 +01:00
Guido Fioravantti
710a3c9672 Removes ability to examine all relations for _CDB_Unique_Column_Identifier 173 2015-10-26 16:17:25 +01:00
Guido Fioravantti
bb18d71995 Adds comment for magic number and constant for maxlen 173 2015-10-26 16:15:55 +01:00
Guido Fioravantti
629214f32f Adds explanation for SCHEMA DEFAULT NULL 173 2015-10-26 15:54:08 +01:00
Guido Fioravantti
270d5b3146 Remove code from deprecated methods 173 2015-10-26 15:50:19 +01:00
Guido Fioravantti
b4acfeca22 Fixes Typo in throwing exception 173 2015-10-23 10:38:24 +02:00
Guido Fioravantti
aed8671e77 Uses underscore prefix for private tables 173 2015-10-22 19:00:18 +02:00
Guido Fioravantti
58deeb088d Raises error on deprecated methods. 2015-10-22 18:56:50 +02:00
Guido Fioravantti
8479c3375b Adds CDB_Unique_Column_Identifier for columns 173 2015-10-22 17:01:47 +02:00
Guido Fioravantti
5dfe56a664 Moves new CDB_Unique_Identifier and _CDB_Octet_Trim to CDB_Helper.sql file 2015-10-22 12:38:00 +02:00
Guido Fioravantti
5f46ff10e9 Doc change 172 2015-10-21 17:35:13 +02:00
Guido Fioravantti
7c14dd8212 Adds new functions to generate length aware identifiers 172 2015-10-21 17:33:01 +02:00
Luis Bosque
d1d5ed6df3 Optimize invalidation time logging 2015-10-19 14:09:52 +02:00
Luis Bosque
37160c7b35 Write invalidation duration in postgresql log 2015-10-16 18:23:18 +02:00
Alejandro Martínez
811c7474de Merge pull request #170 from CartoDB/fix-schema-group-sequence
Fix schema not being specified on pg_get_serial_sequence
2015-10-15 17:39:46 +02:00
Stuart Lynn
eb475fe55f Adding function to produce a great circle between two points. 2015-10-14 11:36:48 -04:00
Alejandro Martínez
1f63811383 Fix schema not being specified on pg_get_serial_sequence 2015-10-06 18:09:37 +02:00
Rafa de la Torre
15dd4935d6 Merge pull request #168 from CartoDB/148-cartodbfy-checks-for-null-cartodb-id
148 cartodbfy checks for null cartodb id
2015-10-06 14:39:00 +02:00
Guido Fioravantti
186ed34ee5 Overloads CDB_DateToNumber() and adds test 2015-10-05 13:32:03 +02:00
Guido Fioravantti
e4ce12d1a3 Changes CDB_DateToNumber() to accept timestamps with time zones 2202 2015-10-05 11:51:13 +02:00
Guido Fioravantti
3429e93979 Makes cartodbfy check for null cartodb_id 2015-09-29 18:04:00 +02:00
Juan Ignacio Sánchez Lara
1f72be0390 Merge branch 'master' into 103-Extension_Group_API 2015-09-28 09:48:46 +02:00
Juan Ignacio Sánchez Lara
0081ec16a9 Sync-flag functions should be private 2015-09-27 18:42:24 +02:00
Juan Ignacio Sánchez Lara
e7008d04ee https support back 2015-09-25 19:13:04 +02:00
Juan Ignacio Sánchez Lara
3330421887 sync parameter at group functions closes #162 2015-09-25 19:02:39 +02:00
Rafa de la Torre
567e815fd0 Add DROP FUNCTION back to allow migrations #160 2015-09-24 17:56:00 +02:00
Juan Ignacio Sánchez Lara
a0204d50db X-Forwarded-Proto 2015-09-21 19:01:40 +02:00
Juan Ignacio Sánchez Lara
a2ddb76ef3 Shorter admin role name 2015-09-21 16:31:12 +02:00
Juan Ignacio Sánchez Lara
cc1e357caa Removed unnecessary EXECUTEs 2015-09-21 15:47:52 +02:00
Juan Ignacio Sánchez Lara
0e4f3955f6 1108 separator for cleaner SQL 2015-09-21 15:37:10 +02:00
Juan Ignacio Sánchez Lara
8fdf5cb9c4 Merge branch 'master' into 103-Extension_Group_API 2015-09-21 14:52:37 +02:00
Juan Ignacio Sánchez Lara
bf4f30c99d Removed IMMUTABLE for functions depending on current database 2015-09-21 14:35:28 +02:00
Rafa de la Torre
5ea1b7d4d7 Fix creation of type _cdb_has_usable_geom_record
Fix the ERROR:  type "_cdb_has_usable_geom_record" already exists by
checking for existence before. Duly noted for upgrades.
2015-09-21 14:16:32 +02:00
Juan Ignacio Sánchez Lara
458cbf2a80 Merge branch 'master' into 103-Extension_Group_API 2015-09-21 12:21:58 +02:00
Rafa de la Torre
0c14df5f89 Fix upgrade from 0.10.0 to 0.10.1 2015-09-16 14:40:18 +02:00
Rafa de la Torre
6ba809e798 Remove usage of _CDB_Geometry_SRID #154
This is only used from _CDB_Has_Usable_Geom. It doesn't do what's
promised in the comment. The effect is that a column is taken as valid
when it actually needs setting its SRID restriction so better not use
it as it will need rewrite anyway.
2015-09-16 12:17:40 +02:00
Rafa de la Torre
0ebd12a0eb Avoid double-escaping of reloid::text #141 2015-09-15 18:49:59 +02:00
Rafa de la Torre
e7c974e957 Fix silly typo #141 2015-09-15 18:49:59 +02:00
Rafa de la Torre
789e89a5d2 Create a return type for _cdb_has_usable_geom_record #141 2015-09-15 18:49:59 +02:00
Rafa de la Torre
3fdce65368 Move column renaming out of _CDB_Has_Usable_Geom #141 2015-09-15 18:49:59 +02:00
Rafa de la Torre
5caddc6cc7 Fix for MultiPoint geometry issue #141 2015-09-15 18:49:59 +02:00
Rafa de la Torre
1596bd56d8 Improve another EXECUTE+FOUND #141 2015-09-14 17:54:35 +02:00
Rafa de la Torre
dfd0454be3 Improve comment #141 2015-09-14 17:53:34 +02:00
Rafa de la Torre
731ee0a9ba Fix the_geom_webmercator already exists #141 2015-09-14 17:06:24 +02:00
Rafa de la Torre
e3bba2ee4b Fix the_geom already exists error #141 2015-09-14 17:05:14 +02:00
Rafa de la Torre
581835d4ff Extract query into _cdb_geom_candidate_columns #141 2015-09-14 11:50:10 +02:00
Rafa de la Torre
9ec24c1aff Fix FOUND in _CDB_Geometry_SRID #141 2015-09-14 11:18:12 +02:00
Rafa de la Torre
7a247c1ab2 Recover usage of cartodb id if has_usable_primary_key #138 2015-09-10 18:20:52 +02:00
Rafa de la Torre
ef21128099 Explicitly check if there's a sequence on PK #138 2015-09-09 18:33:06 +02:00
Alejandro Martínez
9ec5d9000a Readd update_updated_at function (still used by old tables) 2015-09-09 14:56:34 +02:00
Juan Ignacio Sánchez Lara
206cee1647 Deletion operations return 204 2015-09-09 12:24:54 +02:00
Juan Ignacio Sánchez Lara
f70fd1a4c7 Merge branch 'master' into 103-Extension_Group_API 2015-09-07 13:37:21 +02:00
Raul Ochoa
5abe6e0b3d Merge branch 'master' into cdb_querytables_quoted
Conflicts:
	test/extension/test.sh
2015-09-07 12:17:36 +02:00
Raul Ochoa
1eabc5e880 Merge pull request #131 from CartoDB/column-regclass-functions
Column regclass
2015-09-07 12:11:59 +02:00
Raul Ochoa
c6cdaea626 Merge pull request #124 from CartoDB/add-kurtosis
Add kurtosis and skewness
2015-09-07 12:11:34 +02:00
Juan Ignacio Sánchez Lara
275e5154fd Fixed comment 2015-09-07 11:48:18 +02:00
Juan Ignacio Sánchez Lara
154eff6d25 Array notation for batch group functions 2015-09-07 11:43:46 +02:00
Juan Ignacio Sánchez Lara
b73eb486a5 Old functions cleanup 2015-09-07 10:35:32 +02:00
Juan Ignacio Sánchez Lara
59d144d91d Batch add/remove users support 2015-09-07 10:35:04 +02:00
Juan Ignacio Sánchez Lara
428a2391ad Refactor Member -> User 2015-09-07 09:56:59 +02:00
Andy Eschbacher
83b7f47617 removing raise notices and lower test bounds 2015-09-03 22:43:25 -04:00
Juan Ignacio Sánchez Lara
0896b1451a Spaces support fixes #135 2015-09-03 20:41:19 +02:00
Juan Ignacio Sánchez Lara
dfec191a9a Support for spaces inside group names, fixed 2015-09-03 16:51:06 +02:00
Juan Ignacio Sánchez Lara
1b5b3f741f Support for spaces inside group names 2015-09-03 16:38:12 +02:00
Raul Ochoa
4be7d4a497 Use quote_ident to quote schema and table names when necessary
Fixes #133
2015-09-03 13:12:29 +02:00
Raul Ochoa
afecef0e31 Removing redundant ::regclass casting 2015-09-02 12:25:44 +02:00
Raul Ochoa
7582f2cbc5 CDB_ColumnType uses schema and table from regclass
Fixes #130
2015-09-02 12:06:04 +02:00
Raul Ochoa
4b5c5dd275 CDB_ColumnNames uses schema and table name from regclass
Fixes #122
2015-09-02 12:04:52 +02:00
Juan Ignacio Sánchez Lara
a003ab7f6a Merge branch 'master' into 103-Extension_Group_API 2015-08-31 13:27:21 +02:00
Rafa de la Torre
0ba57f436a Do not remove old function #120
The `DROP FUNCTION IF EXISTS` was added as transient code and not needed
anymore. See the ticket #120 for more information on this.
2015-08-31 12:01:04 +02:00
Juan Ignacio Sánchez Lara
15aece1fbc Use %s for sequence name, which is already quoted 2015-08-27 17:03:13 +02:00
Juan Ignacio Sánchez Lara
e1f8a65cce Use %s for sequence name, which is already quoted 2015-08-27 17:02:05 +02:00
Rafa de la Torre
0057e2ddec Fix for index generation when renaming table #123 2015-08-27 16:33:46 +02:00
Rafa de la Torre
79cacb8ef4 Modify sampling of table quota trigger #126 2015-08-27 12:52:30 +02:00
Juan Ignacio Sánchez Lara
fc32d457eb String interpolation with %I, which includes quoting 2015-08-27 10:25:52 +02:00
Juan Ignacio Sánchez Lara
a4952f6a1e Granting RW permission on a table should also grant permission on default values sequences 2015-08-26 13:33:01 +02:00
Juan Ignacio Sánchez Lara
1f67b52bf7 Documented the need for create extension and separated from cdb_conf creation 2015-08-26 13:23:32 +02:00
Andy Eschbacher
d723487f67 updated definition 2015-08-25 23:10:26 -04:00
Andy Eschbacher
db323f3e13 adding skewness 2015-08-25 22:58:31 -04:00
Andy Eschbacher
49c4cea4e7 adding kurtosis 2015-08-25 22:45:55 -04:00
Rafa de la Torre
7f63688a2f New version 0.9.2 2015-08-24 15:20:50 +02:00
Paul Ramsey
8c2252a9cb Handle text 'the_geom' columns as desired in #117 2015-08-21 13:10:05 -07:00
Juan Ignacio Sánchez Lara
c6fa292f01 Extension installation ready 2015-08-20 17:39:28 +02:00
Juan Ignacio Sánchez Lara
faa4f203d6 Changed sample config 2015-08-20 17:32:36 +02:00
Juan Ignacio Sánchez Lara
66e2082266 Missing cartodb schema 2015-08-20 13:02:02 +02:00
Juan Ignacio Sánchez Lara
43d41e5c26 Removed cached (won't work between sessions) 2015-08-20 12:55:22 +02:00
Juan Ignacio Sánchez Lara
bd31419e94 Fixed return auth 2015-08-20 12:54:46 +02:00
Juan Ignacio Sánchez Lara
600f9159fb {} >> dict() 2015-08-20 10:25:31 +02:00
Juan Ignacio Sánchez Lara
eb912b48bf Removed not needed json import 2015-08-20 10:22:44 +02:00
Juan Ignacio Sánchez Lara
9c70e5f91a Merge branch 'master' into 103-Extension_Group_API 2015-08-20 10:17:00 +02:00
Juan Ignacio Sánchez Lara
551e09ff6f Secured _CDB_Group_API_Request 2015-08-20 10:03:48 +02:00
Juan Ignacio Sánchez Lara
97dd8e5720 Conf value type to json 2015-08-20 08:44:59 +02:00
Rafa de la Torre
5dd497bf20 Fix transformation to webmercator in corner cases #116 2015-08-19 19:37:50 +02:00
Juan Ignacio Sánchez Lara
e1d195a21f Merge branch 'master' into 103-Extension_Group_API 2015-08-19 18:51:37 +02:00
Juan Ignacio Sánchez Lara
75c4308ea9 Grant and revoking permissions API sync 2015-08-19 18:43:25 +02:00
Rafa de la Torre
74e6807c2f Merge pull request #78 from CartoDB/new_cartodbfy
[wip] New cartodbfy function (overwrites CDB_CartodbfyTable)
2015-08-19 15:11:55 +02:00
Juan Ignacio Sánchez Lara
70fe432102 Secured configuration access 2015-08-19 11:20:06 +02:00
Juan Ignacio Sánchez Lara
e1dde3c36c Removed old code 2015-08-19 11:08:05 +02:00
Juan Ignacio Sánchez Lara
6c1369f2a9 Documentation about roles and functions 2015-08-19 11:05:32 +02:00
Juan Ignacio Sánchez Lara
726f3c31f7 Documentation about roles and functions 2015-08-19 11:03:07 +02:00
Juan Ignacio Sánchez Lara
2245c05b1e Don't allow users to pick database name, keeping group operations inside their org 2015-08-19 10:52:07 +02:00
Juan Ignacio Sánchez Lara
1fe9bb2e84 Don't allow users to pick database name, keeping group operations inside their org 2015-08-19 10:37:52 +02:00
Juan Ignacio Sánchez Lara
0cb55d043a Revoke select on table and add security definer for conf getter 2015-08-19 10:35:23 +02:00
Rafa de la Torre
805af3babf Review of format strings and escaping of id's
Just found cartodbfy failed for schema-names-with-dashes. This should
fix it.
2015-08-18 17:05:32 +02:00
Juan Ignacio Sánchez Lara
fd25a02b45 Merge branch 'master' into 103-Extension_Group_API 2015-08-18 16:07:22 +02:00
Rafa de la Torre
78bf202b17 Fix for schema-with-dashes 2015-08-18 15:41:11 +02:00
Juan Ignacio Sánchez Lara
67d7e28684 409 is a valid renaming response 2015-08-18 13:26:23 +02:00
Juan Ignacio Sánchez Lara
a8b9ec345a valid_return_codes parameter 2015-08-18 11:53:38 +02:00
Juan Ignacio Sánchez Lara
a75a337296 _CDB_Conf_Cache SD-based 2015-08-18 10:44:10 +02:00
Juan Ignacio Sánchez Lara
1217b4e4a4 Cache http client with private SD 2015-08-18 08:27:14 +02:00
Juan Ignacio Sánchez Lara
d6410d91bd Cache http client 2015-08-18 08:24:30 +02:00
Juan Ignacio Sánchez Lara
9d03e755b8 _CDB_Group_API_Request refactor 2015-08-18 08:10:02 +02:00
Rafa de la Torre
3f588df6f6 Drop function in order to change return value 2015-08-17 15:28:37 +02:00
Rafa de la Torre
2b48f90374 Merge remote-tracking branch 'origin/master' into new_cartodbfy
Conflicts:
	test/CDB_QuotaTest.sql
2015-08-17 15:27:33 +02:00
Juan Ignacio Sánchez Lara
87a955b56a Removed cdb_ prefix from local variables 2015-08-17 15:23:39 +02:00
Juan Ignacio Sánchez Lara
653eae21b3 _CDB_Group_RemoveMember_API 2015-08-17 15:20:15 +02:00
Juan Ignacio Sánchez Lara
e4a56371c0 _CDB_Group_AddMember_API 2015-08-17 15:05:09 +02:00
Juan Ignacio Sánchez Lara
00e9cc5a79 Explicit null check for not found role 2015-08-17 15:02:21 +02:00
Juan Ignacio Sánchez Lara
566adfb0ce CDB_Group_RenameGroup_API 2015-08-17 13:37:34 +02:00
Juan Ignacio Sánchez Lara
99641b827c Authorization type moved to function 2015-08-17 12:55:42 +02:00
Juan Ignacio Sánchez Lara
df531e9e37 auth inside param reading 2015-08-17 12:26:38 +02:00
Juan Ignacio Sánchez Lara
6c3555f21a Configuration parameters refactor 2015-08-17 11:49:31 +02:00
Raul Ochoa
50169e58d5 Raise better notice on _CDB_total_relation_size errors 2015-08-17 10:25:31 +02:00
Raul Ochoa
6bc91c7125 Using exception with pg_total_relation_size for better performance
IF EXISTS is too slow, one order of magnitude, than using exception
handling. In combination with thousands of tables to check total
relation size that's a problem.

Exception handles specifically undefined_table as it was the original
issue but also any other exception to guarantee a size is always
returned and no error is raised.
2015-08-17 10:17:07 +02:00
Rafa de la Torre
47d8429277 Use return value from cartodbfy 2015-08-14 17:41:55 +02:00
Rafa de la Torre
565edcb50d Make cartodbfy return destoid 2015-08-14 16:53:43 +02:00
Juan Ignacio Sánchez Lara
a08600a1f8 Exclude cartodb schema from CDB_UserTables 2015-08-14 16:31:19 +02:00
Rafa de la Torre
b7b5be1f3f Add minor piece of doc 2015-08-14 16:10:38 +02:00
Juan Ignacio Sánchez Lara
e11f4ef169 Group name validation delegated to role creation 2015-08-14 15:40:36 +02:00
Juan Ignacio Sánchez Lara
db89bf1a94 Grant select on configuration table to org members 2015-08-14 15:28:19 +02:00
Juan Ignacio Sánchez Lara
466e4d81c6 format instead of string concatenation 2015-08-14 15:22:00 +02:00
Juan Ignacio Sánchez Lara
ae634e7814 Server notification must happen after role creation 2015-08-14 15:04:14 +02:00
Juan Ignacio Sánchez Lara
d1f19a0234 Groups API configuration example 2015-08-14 14:03:53 +02:00
Juan Ignacio Sánchez Lara
d4bcb97f9b CDB_CONF and create and drop group api calls 2015-08-14 14:00:58 +02:00
Juan Ignacio Sánchez Lara
a0aac4e9c9 Info about if not exist log output 2015-08-14 14:00:58 +02:00
Juan Ignacio Sánchez Lara
725453ce2b Configuration table and functions 2015-08-14 14:00:58 +02:00
Juan Ignacio Sánchez Lara
7262d34b06 IMMUTABLE-STABLE-VOLATILE specification 2015-08-14 14:00:58 +02:00
Juan Ignacio Sánchez Lara
3ee4978240 Roles simplification, without md5 and prepending database name 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
79e1926766 Group management done by organization admin 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
e2dd1e014e test_valid_group_names and test_not_valid_group_names 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
bd46796bb7 Fix spacing 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
154f6df1dc _CDB_Group_GroupRole based on current database m5 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
9a3fbb668c Dynamic variable binding 2015-08-14 14:00:57 +02:00
Juan Ignacio Sánchez Lara
52f73b1a01 CDB_Group_Table_GrantReadWrite 2015-08-14 14:00:26 +02:00
Juan Ignacio Sánchez Lara
28af048c92 Methods doc 2015-08-14 14:00:26 +02:00
Juan Ignacio Sánchez Lara
1279742e50 CDB_Group_CreateGroup should not return role, since it's an internal implementation detail 2015-08-14 14:00:26 +02:00
Juan Ignacio Sánchez Lara
b633466724 Non-public API method naming 2015-08-14 14:00:26 +02:00
Juan Ignacio Sánchez Lara
e04f0caa6c Permission granting 2015-08-14 14:00:25 +02:00
Juan Ignacio Sánchez Lara
5afdd77dcf Rename group 2015-08-14 14:00:25 +02:00
Juan Ignacio Sánchez Lara
42e72ac9d5 cartodb.CDB_Group_CreateGroup cartodb.CDB_Group_DropGroup 2015-08-14 13:58:10 +02:00
Rafa de la Torre
72ebc398f8 Recover _CDB_check_prerequisites (sorry, my fault) 2015-08-14 12:30:01 +02:00
Paul Ramsey
7f55a0263b Fix regclass mismatch on column alter/drop
This logic SHOULD BE MOVED TO Cartodbfy internals.
2015-08-13 16:10:23 -07:00
Paul Ramsey
d268cd07cb Fix many tests and handle ownership issues involved
with Cartodbfy being invoked by schema triggers. Some
issues with regclass interpretation in tests still remain.
Some issues with slightly different behavior to old version
remain. Some issues with error messages / notification messages
changing a little still remain.
2015-08-13 15:59:45 -07:00
Raul Ochoa
4e31d3a37e Fixes CDB_UserDataSize failing due ERROR: relation "*" does not exist.
Adds new _CDB_total_relation_size function that handles nonexistent
tables and does fallback to size=0.

That function could be used to cache total relation size or query another
table view with a cached total relation size.

Fixes #108
2015-08-13 13:23:35 +02:00
Rafa de la Torre
a5321ec7a5 Replace CDB_CartodbfyTable by new CartodbfyTable2
- Delete old CDB_CartodbfyTable code
- Delete auxiliary functions no longer used
- Modify the new CDB_CartodbfyTable signature to be backwards
  compatible.
2015-08-12 18:39:07 +02:00
Rafa de la Torre
c00d607ee2 Merge pull request #107 from CartoDB/new_cartodbfy_rtorre
Do not create timestamp columns/triggers on cartodbfy
2015-08-12 18:34:33 +02:00
Rafa de la Torre
8c41203db6 Fix for the_geom does not exist
When creating triggers, expectation is to have the columns the_geom and
the_geom_webmercator even if the source table does not have any geometry
columns. Populate it in the rewrite with NULL values and right types.
2015-08-12 17:34:47 +02:00
Rafa de la Torre
d6afdf751f Do not create timestamp columns/triggers on cartodbfy 2015-08-11 19:07:01 +02:00
Paul Ramsey
1a1f45cdad Add raster table calls, like the old function has 2015-08-11 05:40:31 -07:00
Paul Ramsey
b195aa4b68 Enable trigger addition routine 2015-08-10 08:42:13 -07:00
javi
df36e83cb5 revoke permissions to list private tables to public user 2015-07-27 10:31:55 +02:00
Paul Ramsey
734561de4c Use 'publicuser' as public role, not 'public', closes #95.
This is consistent with cartodb behaviour, but not exactly
the same as the contract that the 'public' role guarantees
access to public resources. Possibly a better fix would be
to audit (ug) everything and make sure that it's really
using the public role to mean public, rather than the
'publicuser' connection role. That CDB creates.
2015-07-07 05:49:28 -07:00
Rafa de la Torre
a6fd829669 Fix for upgrade issue from 0.7.4 to 0.8.0
This fixes the following problem found during testing:
```
ALTER EXTENSION cartodb UPDATE TO '0.8.0';
ERROR:  cannot change return type of existing function
HINT:  Use DROP FUNCTION cdb_usertables(text) first.
```
2015-06-30 12:20:29 +02:00
Raul Ochoa
8190edb461 Merge pull request #83 from CartoDB/64-usertables
Replace CDB_UserTables with something that can handle multi-user accounts
2015-06-30 11:33:32 +02:00
Andy Eschbacher
e5897f3dad Merge pull request #87 from CartoDB/categ-distrib
Function deciding criteria for using a category column in a map
2015-06-25 11:50:56 -04:00
Andy Eschbacher
b9fe204007 Merge pull request #81 from CartoDB/equalint
adding equal interval function for consistency
2015-06-25 11:08:24 -04:00
Andy Eschbacher
13946b4d47 update test output 2015-06-25 08:17:41 -04:00
Andy Eschbacher
97140b17c9 added more flexible output values 2015-06-24 11:03:16 -04:00
Rafa de la Torre
ddb6b2c5b5 Return text instead of regclass #86
This way the schema is always returned and backwards compatibility is
kept, should it be needed.
2015-06-24 14:14:00 +02:00
Rafa de la Torre
9a94b3879a Add a new function CDB_QueryTablesRegclass #86
The return values of it can be safely used when len(schema.table_name)
exceeds the 63 char limit of the postgres type `name`.
2015-06-24 11:53:09 +02:00
Andy Eschbacher
d124776c4e simplified assignment 2015-06-23 18:49:59 -04:00
Andy Eschbacher
5941b473ca removed notice 2015-06-23 18:39:15 -04:00
Andy Eschbacher
cda6953ea6 initial commit 2015-06-23 16:27:27 -04:00
Andy Eschbacher
1d223b77cc changed subfunction name, replaced function with case statement 2015-06-10 10:50:01 -04:00
Andy Eschbacher
6ab1b1d3d0 removed unneeded variables 2015-06-08 18:36:07 -04:00
Andy Eschbacher
c7f4209270 added alias and line 2015-06-08 15:11:58 -04:00
Andy Eschbacher
8e2d86414f updating function 2015-06-08 15:02:39 -04:00
Andy Eschbacher
424564e324 initial commit 2015-06-08 13:37:27 -04:00
Paul Ramsey
54973142f6 Handle "unsupported argument" case for CDB_UserTables
in support of #64
2015-06-01 10:37:46 -07:00
Paul Ramsey
ba521461fe Replace CDB_UserTables with new version
fix for #64
2015-06-01 09:47:02 -07:00
Andy Eschbacher
16d0dc739a added tests improved func 2015-05-14 15:32:58 -04:00
Andy Eschbacher
dcd35fc3d7 Merge branch 'master' into equalint 2015-05-07 17:07:34 -04:00
Andy Eschbacher
2ad3ff547d initial 2015-05-07 15:49:35 -04:00
Andy Eschbacher
1552c03dd4 removed group by; made binning more reliable 2015-04-27 17:59:40 -04:00
Paul Ramsey
0899c64d0b Break routine into two halves 2015-04-22 13:25:11 -07:00
Paul Ramsey
c1bfef25e0 Fix no-op case error 2015-04-22 13:06:34 -07:00
Paul Ramsey
dd209d02f6 Use standard error message format 2015-04-22 12:51:36 -07:00
Paul Ramsey
614a446cba Document functions a bit more 2015-04-22 09:29:23 -07:00
Paul Ramsey
8dc7f45cca Re-use columns named 'cartodb_id' if the values of the
keys are in fact unique.
2015-04-22 06:33:49 -07:00
Paul Ramsey
74b7740892 Fix bug with missing non-geo columns in case where
geo columns are "perfect" to start w/.
2015-04-21 12:59:44 -07:00
Paul Ramsey
bb685795d5 Handle geometry column with no metadata SRID (grrr) but
a valid SRID on the geometry objects themselves
2015-04-21 06:58:33 -07:00
Paul Ramsey
14414c4bf3 Fix Rambo's test case, of a single geometry-only table
with no SRID in the metadata (thanks mate).
2015-04-21 06:25:35 -07:00
Paul Ramsey
f3c20ac2fb First draft of new cartodbfy function (named CDB_CartodbfyTable2)
Still needs to be fully tested (partially tested now) using
the existing regression tests. Does not manage the timestamp
columns at this time.
2015-04-17 17:53:07 +02:00
sariogonfer
cbd3c447b6 Update CDB_QuantileBins.sql 2015-04-14 20:45:37 +02:00
Rafa de la Torre
1c9e5f241f Fix upgrade of CDB_StringToDate function #73 2015-03-03 16:09:57 +00:00
Rafa de la Torre
61804187c8 Fix conversion of strings to datetimes #73 2015-03-03 09:49:33 +00:00
Kartones
0a3d08edc3 #revert-size_calc 2015-02-27 10:53:14 +01:00
Raul Ochoa
ebcca141bd Adds CDB_ZoomFromScale function. Closes #62 2015-02-19 14:20:35 +01:00
Raul Ochoa
da7b3b7080 Adds CDB_TableMetadataTouch function to be able to upsert updated_at
value in cdb_tablemetadata
2015-02-18 17:08:46 +01:00
Raul Ochoa
38fe98d983 Merge branch 'master' into remove-grant-select-from-cdb_tablemetadata-to-public 2015-02-18 15:43:16 +01:00
Kartones
6c7706672f #69 now using pg_relation_size 2015-02-17 15:40:26 +01:00
javi
519ea075d6 fixed reg exp 2015-02-13 17:32:14 +01:00
javi
0223d00a54 fixed security problem 2015-02-12 10:57:12 +01:00
Raul Ochoa
3cf62ecd2e Do not grant select permission to public user
- Fake the behaviour in tests by switching between users
2015-02-10 15:27:42 +01:00
Rafa de la Torre
693b147ef1 Fix corner case (no tables) in CDB_UserDataSize #65 2015-01-29 15:46:08 +00:00
Rafa de la Torre
a4e42571cd Add a comment to CDB_UserDataSize (from PR) #65 2015-01-28 17:10:04 +00:00
Rafa de la Torre
bf622ae5a6 Optimize CDB_UserDataSize (on behalf of @javisantana) #65 2015-01-28 16:54:50 +00:00
Kartones
dbb6f42b99 #1368 fixed escapings 2014-12-05 17:30:47 +01:00
Kartones
cd9e44b266 #1138 Fixed DDL triggers to properly use new cartodbfy signature, fixed cartodbfy to properly send params to check raster table 2014-11-19 10:00:04 +01:00
Kartones
fd9d79372f #1138 Found issue with DDL triggers 2014-11-18 19:00:33 +01:00
Kartones
61b47617b8 #1138 fixes for specs 2014-11-18 17:35:11 +01:00
Kartones
3b5c1f65cb #1138 Quota changes, raster import cartodbfication and quota spec 2014-11-18 15:24:54 +01:00
Kartones
b7c2336ae0 #1138 not counting raster overviews for quota 2014-11-14 10:34:18 +01:00
Kartones
f251e12d35 CDB-4418 2014-10-21 16:19:44 +02:00
javi
723a08e814 added CDB_Math_mode 2014-08-19 18:09:27 +02:00
Kartones
6c57640901 CDB-3870 replaced priority of qmax inside checkquota 2014-08-11 15:26:13 +02:00
Raul Ochoa
5bb638b995 Merge pull request #45 from CartoDB/CDB-3743
CDB_QueryTables returns only results for schemas associated to Relation-Names
2014-08-01 18:14:53 +02:00
Raul Ochoa
2637742c2e CDB-3743 Makes CDB_QueryTables to return only results for schemas associated to Relation-Names 2014-08-01 18:06:06 +02:00
Kartones
679af1d4a3 CDB-3497 Finished stabilizing specs 2014-07-28 17:53:19 +02:00
Kartones
6d665ab163 CDB-3497 ongoing spec stabilization 2014-07-28 15:16:19 +02:00
Kartones
e5c8015e17 CDB-3497 Splitted 2014-07-28 13:11:51 +02:00
Kartones
f61d07518d CDB-3497 ongoing splitting 2014-07-28 12:25:42 +02:00
Kartones
b5589fdf09 CDB-3497 2014-07-25 12:19:40 +02:00
Kartones
9500010a67 CDB-3497 Partial splitting 2014-07-25 10:52:46 +02:00
Raul Ochoa
2bd0b223a6 CDB_SetUserQuotaInBytes returning set value instead of previous value. 2014-07-07 10:36:51 +02:00
Raul Ochoa
5806ac8f8d Force schema so it can calculate the size of the database with the proper schema 2014-07-04 18:50:46 +02:00
Kartones
1c86599f9d CDB-3094 Discovered that EXECUTE FORMAT seems to quote schema names when it needs to 2014-07-04 16:39:19 +02:00
Kartones
3c5251e6c6 CDB-3303 Cartodbfication also supporting optional schemas 2014-07-04 15:55:08 +02:00
Kartones
3d595976f6 CDB-3302 CDB_CheckQuota now also accepts a schema name. Added a convenience method to check if a schema is valid or not 2014-07-04 11:48:53 +02:00
Kartones
021d922d84 CDB-3304 Method cdb_userdatasize now has schema_name param, and added backwards-compatible version without it 2014-07-04 10:57:55 +02:00
Luis Bosque
82f2e7336b Quoted schema references in organization sql 2014-07-03 15:33:36 +02:00
Raul Ochoa
558be8b693 CDB-3094 DELETE permission for read-write rule 2014-06-27 00:01:25 +01:00
Raul Ochoa
b98419aeb8 Merge remote-tracking branch 'rambo/cdb_querytables_support_schemas' into CDB-3094 2014-06-26 08:12:41 +02:00
javi
da9b9a640f CDB_QueryTables return tables with schema 2014-06-25 19:38:29 +02:00
Raul Ochoa
55efde5039 CDB-3094 Makes organization member group role name unique to database by using the database name md5 hash 2014-06-25 12:38:14 +02:00
Raul Ochoa
12e90ef6a4 CDB-3094 Adds cdb_org_member role group and functions to handle access to tables through it 2014-06-24 19:56:17 +02:00
Raul Ochoa
625b01ed56 CDB-3094 Removes for now the role groups management as it is not clear if we need them 2014-06-19 20:16:10 +02:00
Raul Ochoa
5e5471c474 CDB-3094 changes signature to allow specifying the schema because it does not have to be the role name.
- fixes tests to match new signature.
- does not revoke access to the schema when revoking access to a table. TODO
2014-06-19 20:16:10 +02:00
Raul Ochoa
8dec91de87 Merge branch 'master' of https://github.com/CartoDB/cartodb-postgresql into CDB-3094 2014-06-16 18:56:34 +02:00
Raul Ochoa
9a55b03d6f CDB-3094 initial function to share tables/schemas between users within the same database 2014-06-16 16:10:53 +02:00
Sandro Santilli
bc0966c46e Do not add unique index on cartodb_id if already a primary key
Closes #38
2014-06-11 19:21:19 +02:00
Sandro Santilli
81bbfcbda8 Drop useless DEFAULT specification in plpgsql variable declarations 2014-06-11 11:25:25 +02:00
Sandro Santilli
f75c256b6e Another full qualification of CDB_TransformToWebmercator in CDB_CartodbfyTable 2014-06-06 18:09:41 +02:00
Sandro Santilli
d52556c20e Fully qualify call to CDB_TransformToWebmercator from CDB_CartodbfyTable 2014-06-06 17:28:43 +02:00
Sandro Santilli
f8180123eb Grant permission to run table-info functions to public
This is needed as a way to migrate from versions < 0.2.0
See #36
2014-06-06 11:36:19 +02:00
Sandro Santilli
01ae7b8c10 Drop role management
Roles are not created anymore, previously private functions for table
information extraction (CDB_UserTables, CDB_TableIndexes, CDB_ColumnNames,
CDB_ColumnType) will now be callable by anyone while only returning
information about tables over which the calling user has SELECT privilege.

Closes #36
2014-06-06 11:02:51 +02:00
Sandro Santilli
f9f73d2d62 Fix potential infinite loop in CDB_QueryStatements
This fix was already present at one point in cartodb/lib/sql
(where the code was copied from) but in a different branch than
the one the code was initially copied from.

The fix depends on plpython language which becomes a new dependency.
2014-06-05 15:00:57 +02:00
Sandro Santilli
a92d7d7d37 Add cdb_extension_reload() utility function 2014-06-04 10:31:03 +02:00
Sandro Santilli
ce20009fb2 Workaround PostgreSQL bug possibly triggering infinite loops
Implements casting of existing system column values during
cartodbfication using ALTER rather than UPDATE.

It's faster for tables with many rows and works around a
longstanding PostgreSQL bug. See
http://www.postgresql.org/message-id/20140530143150.GA11051@localhost

CDB-3059
2014-05-30 19:24:19 +02:00
Sandro Santilli
cc9cbdb7a7 Typo 2014-05-30 18:35:08 +02:00
Sandro Santilli
ac53d6b000 Formatting only change 2014-05-30 12:22:54 +02:00
Sandro Santilli
f5ad0d0434 Fully qualify call to CDB_UserDataSize from quota trigger 2014-05-28 17:42:11 +02:00
Sandro Santilli
bfd56f0ea6 Fully qualify call to cdb_disable_ddl_hooks from cdb_enable_ddl_hooks 2014-05-28 12:53:22 +02:00
Sandro Santilli
004c3c5543 Ensure cartodb_id uses an associated sequence
Closes #33
2014-05-28 10:45:42 +02:00
Sandro Santilli
2601364011 Fix recursive DDL trigger on create table
Closes #32
2014-05-28 09:02:02 +02:00
Sandro Santilli
09cf368d62 Move DDL triggers and extension postamble under scripts-available
Target 0.2.0
2014-05-23 17:40:14 +02:00
Sandro Santilli
348177d23a Fix cartodbfication of already-cartodbfied tables in presence of views
Closes #30
Includes testcase
2014-05-23 16:54:36 +02:00
Sandro Santilli
102e8bd018 Improve error message on failing CDB_CartodbfyTable 2014-05-23 16:04:54 +02:00
Sandro Santilli
967b7abec0 Try to retain existing cartodb_id values
Also reset sequence when original cartodb_id values correctly
cast to integers, and does not keep a backup in that case.

Closes #27
2014-05-22 14:11:09 +02:00
Sandro Santilli
134d2d29b6 Try to cast TEXT typed updated_at and created_at if present
If the cast fails we'll still rename those fields and create
new ones. See #27 (cartodb_id is still not done)
2014-05-22 13:10:42 +02:00
Sandro Santilli
0082138503 Do not force DROP FUNCTION but rely on CREATE OR REPLACE
We'll bet on no old signature being left around.

Presence of an old signature would break at runtime
with a message like:
ERROR:  function CDB_UserTables() is not unique

Closes #25
2014-05-20 16:39:18 +02:00
Sandro Santilli
2f0031e6a2 Do not call CDB_Invalidate_Varnish() if not owned by a superuser
Search for that function in schemas cartodb and public (in that order).
Closes #24
2014-05-14 19:03:20 +02:00
Sandro Santilli
8d6188e282 Have _CDB_UserQuotaInBytes() take precedence over parameter-based quota
Closes #16
2014-05-12 13:37:47 +02:00
Sandro Santilli
f98071cdac Do not allow cartodbfying tables while no user quota is set
Closes #17
Updates tests
2014-05-12 13:27:44 +02:00
Sandro Santilli
cfd8dbc5a4 Test calls to CDB_Invalidate_Varnish
Also drops the DELETE trigger on CDB_TableMetadata as the call to
CDB_Invalidate_Varnish would then get an OID, which is pretty useless.
Closes #8
2014-05-09 17:34:18 +02:00
Sandro Santilli
b69ded8f66 Let CDB_CheckQuota second parameter override configured user quota
Closes #13
Includes automated test
2014-05-09 12:55:41 +02:00
Sandro Santilli
30186ac8cb Pretend _CDB_UserQuotaInBytes has to stay in public
Fixes run of the testsuite in the pre-extension model
2014-05-08 17:20:40 +02:00
Sandro Santilli
acf3097c3a Add CDB_SetUserQuotaInBytes function
Closes #2
2014-05-08 17:14:06 +02:00
Sandro Santilli
055efe04aa Do not assume existance of a "publicuser" role in CDB_UserTables
Closes #5 (take 2)
2014-05-08 16:42:38 +02:00
Sandro Santilli
9b6f9e21f2 Stick with user tables being in public
... but workaround extension code replacing "public." with "cartodb."
2014-05-06 10:53:19 +02:00
Sandro Santilli
15740f2ef6 Enable running all tests via "installcheck"
NOTE: also makes CDB_TableMetadata triggers still functional
      when user quota and varnish invalidation functions are missing
      from the database (currently installed by cartodb ruby)
2014-05-06 10:18:38 +02:00
Sandro Santilli
0960276046 Import cartodb/lib/sql/test, add search_path tweaker 2014-05-05 18:48:48 +02:00
Sandro Santilli
5e28417b3d Add "cdb_org_admin" and "cdb_org_user" roles as part of extension 2014-05-05 18:04:14 +02:00
Sandro Santilli
2f1fdf5a15 Copy cartodb lib/sql scripts from CDB_CartodbfyTable branch 2014-05-05 17:13:06 +02:00