Open
Description
Is your feature request related to a problem? Please describe.
We are trying to perform parameter substitution in Java using the postures driver. The BACKUP command (and others) does not support the full range of parameter substitutions.
An example error we received whilst trying to identify this was:
org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [BACKUP TO ? AS OF SYSTEM TIME ?::String WITH revision_history, encryption_passphrase = ?]; ERROR: could not determine data type of
placeholder $2; nested exception is org.postgresql.util.PSQLException: ERROR: could not determine data type of placeholder
In the end we identified that we needed: BACKUP to ? AS OF SYSTEM TIME '%s'.
Describe the solution you'd like
It should be possible to substitute all parameters in a SQL command whether it be a database name, an S3 bucket or a column/value. It's not just the BACKUP command where this happens. Others include RESTORE, DROP DATABASE and SHOW BACKUP.
Epic CRDB-7909
Jira issue: CRDB-2859