You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Statement could not be type checked <aid='mapping-statement-could-not-be-type-checked'></a>
175
+
176
+
An error occurred when attempting to type check the SQL statement.
177
+
178
+
### Error message
179
+
180
+
```
181
+
Statement could not be type checked: '{type-check-erro-message}'
182
+
```
183
+
184
+
### Notes
185
+
186
+
CipherStash Proxy checks SQL statements against the database schema to transparently encrypt and decrypt data.
187
+
188
+
The behaviour of Proxy depends on the `mapping_errors_enabled` configuration.
189
+
190
+
When `mapping_errors_enabled` is `false` (the default), then type check errors are logged, and the statement is passed through to the database.
191
+
192
+
When `mapping_errors_enabled` is `true`, then type check errors are raised, and statement execution halts.
193
+
194
+
In our experience, most production systems have a relatively small number of columns that require protection.
195
+
As SQL is large and complex, instead of blocking statements with type check errors that are false negatives, the default behaviour of Proxy is to allow the statement.
196
+
197
+
However, this does mean it is possible that a statement that references encrypted columns cannot be type-checked, and it will be passed through to the database.
198
+
When a statement is passed through to the database, the database's column constraints (provided by EQL) will catch the statement, and return a PostgreSQL error.
199
+
200
+
Example constraint error:
201
+
```sql
202
+
ERROR: Encrypted column missing version (v) field: 34234
203
+
CONTEXT: PL/pgSQL function _cs_encrypted_check_v(jsonb) line6 at RAISE
204
+
SQL function "cs_check_encrypted_v1" statement 1
205
+
```
206
+
207
+
### How to Fix
208
+
209
+
In most cases, this error will occur if the statement contains invalid or unsupported syntax.
210
+
211
+
Check if you are running the latest version of CipherStash Proxy, and update to the latest version if not.
212
+
213
+
If the error persists, please contact CipherStash [support](https://cipherstash.com/support).
Copy file name to clipboardExpand all lines: packages/cipherstash-proxy/src/error.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,8 @@ pub enum MappingError {
80
80
#[error("Encryption of PostgreSQL {name} (OID {oid}) types is not currently supported. For help visit {}#mapping-unsupported-parameter-type",ERROR_DOC_BASE_URL)]
81
81
UnsupportedParameterType{name:String,oid:u32},
82
82
83
-
#[error("Statement could not be type checked: {}. For help visit {}#mapping-statement-could-not-be-mapped", _0,ERROR_DOC_BASE_URL)]
84
-
StatementCouldNotBeMapped(String),
83
+
#[error("Statement could not be type checked: {}. For help visit {}#mapping-statement-could-not-be-type-checked", _0,ERROR_DOC_BASE_URL)]
84
+
StatementCouldNotBeTypeChecked(String),
85
85
86
86
#[error("Statement could not be transformed: {0}")]
0 commit comments