propellerjet opened a new issue, #32564:
URL: https://github.com/apache/superset/issues/32564

   ### Bug description
   
   The bug is reproduced for datasets on PostgreSQL with columns containing 
capital letters.
   Steps:
   1. Create RLS  
   
![Image](https://github.com/user-attachments/assets/e3252950-c5ec-4b62-b77a-c95477961467)
   2. Run select query for this dataset
   
![Image](https://github.com/user-attachments/assets/cb922172-0b18-4e83-bc0d-e34e918b820b)
   
   Identifiers (including column names) that are not double-quoted are folded 
to lower case in PostgreSQL. 
   Identifiers created with double quotes retain upper case letters.
   
   Analyzing the log we found that even we are using double quotes for column 
name in RLS, query that are send to DB from SQL lab doesn't contain double 
quotes. 
   
   This bug is not reproduced on chart
   
![Image](https://github.com/user-attachments/assets/4577f277-14d0-431b-8d7d-e46a888f0f5c)
   The query is generated correctly
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.1.1
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   flag RLS_IN_SQLLAB is applied
   ________________________
   Worker container log
   [2025-03-10 16:44:05,738: INFO/ForkPoolWorker-7] Task 
sql_lab.get_sql_results[28448e7f-351f-45c4-9624-441718fa923a] succeeded in 
0.19986815191805363s: {'query_id': 12018, 'status': 'failed', 'error': 
'postgresql error: column flights.airline does not exist
   
   LINE 3: FROM (SELECT * FROM public.flights WHERE (flights.AIRLINE li...
   
                                                     ^', 'errors': [{'message': 
'postgresql error: column flights.airline does not exist
   
   LINE 3: FROM (SELECT * FROM public.flights WHERE (flights.AIRLINE li...
   
                                                     ^
   
   ', 'error_type': 'GENERIC_DB_ENGINE_ERROR', 'level': 'error', 'extra': 
{...}}]}
   
   ______________________
   DB container log:
   2025-03-10 16:44:05.720 [27282] ERROR:  column flights.airline does not 
exist at character 54
   2025-03-10 16:44:05.720 [27282] STATEMENT:  SELECT
     *
   FROM (SELECT * FROM public.flights WHERE (flights.AIRLINE like 'A%')) AS 
flights
   LIMIT 101
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to