CartoDB / cartodb-postgresql

PostgreSQL extension for CartoDB
BSD 3-Clause "New" or "Revised" License
111 stars 53 forks source link

use literal substitution instead of identifier #387

Closed alrocar closed 4 years ago

alrocar commented 4 years ago

Related issue https://github.com/CartoDB/support/issues/2273

I made a quick test in one of the affected users database and the fix seems to work

rafatower commented 4 years ago

Fine by me, but most likely the problem comes from double quoting, that is, changes in the parameter passed to the function (I can tell for sure this used to work ok under different conditions).

alrocar commented 4 years ago

This is how it's being called from cartodb (which is the origin of the issue):

CDB_UserDataSize('#{self.database_schema}')

I did some manual tests and it seems to happen when the database_schema contains -. I'll try to add some tests to the PR to check that.