简体   繁体   中英

What does double question mark (??) mean in sql (postgres sql)

What does double question mark ( ?? ) mean in sql or sql query. (postgres sql).

My DB Server is Postgres and I am using columns that are of type jsonb.

I see a query that has ?? in it. Below is the query.

select rr.jdoc 
from table_with_jsonb rr 
where not (rr.jdoc ?? 'pivot')  
  and ((rr.jdoc->'mapping'->>'objectType')<>'meta');

Can some one explain what the ?? means and any references will be of great help.

Normally my understand is that - ? is to allow Parameterized Query.
But this table 9.4 ref -> FUNCTIONS-JSONB-OP-TABLE or 13.x ref -> FUNCTIONS-JSONB-OP-TABLE adds more usage scenerios for ? . But still it does not say what ?? is.

PS: Plz ignore the doc references to 9.4. I am using 13.x currently.

It's the same as the ? operator when used through JDBC.

JDBC uses ? for parameter placeholders and thus there needs to be a way to distinguish the operator from the parameter placeholder. So the Postgres JDBC driver allows to escape the ? operator using ?? in a PreparedStatement.

I don't know if other technologies (ODBC, .Net) are using a similar mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM