Use double quotes for whole column name, when querying object attributes
See original GitHub issueUse case: Right now if I want to query a object attribute in crateDB I have to use
SELECT objectName['attributeName'] FROM table;
--or
SELECT "objectName"['attributeName'] FROM table;
Although from the SQL-Syntax-perspective objectName[‘attributeName’] is the whole column name. And column names in PostgreSQL and other SQL syntaxes can be encapsulated in double quotes. For tools with postgres support, they might be able to read the object attribute columns, from the schema, but querying might not work if they encapsulate this names in double quotes automatically (like Grafana does)
Feature description:
I would like to be able to query object attribute columns like this:
SELECT "objectName['attributeName']" FROM table;
This should increase the compatibility with some tools encapsulating column names in double quotes.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Single Quote, Double Quote, and Backticks in MySQL Queries
Quotes (Single and Double) are used around strings. Backticks are used around table and column identifiers. Double Quotes. Using double quotes here is...
Read more >Column Name has quotes - Stack Overflow
If I want to select it how do I do this since there's is double quotes in it? For other columns I have...
Read more >Identifier Requirements - Snowflake Documentation
To use the double quote character inside a quoted identifier, use two quotes. For example: create table "quote""andunquote""" ...
Read more >How to use single and double quotes in PostgreSQL - Prisma
Double quotes are used to indicate identifiers within the database, which are objects like tables, column names, and roles. In contrast, single quotes...
Read more >KB30665: How to change the syntax with column names and ...
The second example shows how double quotes are added around the table and column name. Also brackets or other symbols can be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Although it’s syntactically not completely correct, as @mfussenegger pointed out, we’ve decided to add support for quoted subscript expression to improve usability and client compatibility. See https://github.com/crate/crate/pull/10485.
Thank you for bringing this up.
With the fix of
quote_ident
the problem is solved for Grafana. However Looker adds the double quotes in code and not using thequote_ident
function …