Closed CGenie closed 1 year ago
You can try
(setf *escape-sql-names-p* :literal)
and then see if your query works. However as noted in https://marijnhaverbeke.nl/postmodern/s-sql.html#variable-escape-sql-names-p "Mixed case sensitivity is not currently well supported. Postgresql itself will downcase unquoted identifiers.".
Ok. No response on the use of *escape-sql-names-p* so I am closing this.
Sorry, I didn't notice this and I haven't worked with postmodern for a while.
Thing is, with *escape-sql-names-p*
set to :literal
I now have to quote everything, otherwise I'm getting an error that MYTABLE
(uppercase) doesn't exist :)
Ok. Try this. Leave s-sql:*escape-sql-names-p as :auto (the default) Add your column name to the s-sql:*postgres-reserved-words hash:
(setf (gethash "ownerId" s-sql:*postgres-reserved-words*) t)
Change the configuration variable s-sql:*downcase-symbols* to nil
(setf s-sql:*downcase-symbols* nil)
Now try your query:
(query (:select '|ownerId| :from 'mytable))
That should get you what you want.
OK this works, thank you!
Hello,
I have a column
"ownerId"
in my db. How can I query that using s-sql?I tried:
but it doesn't help and I don't have any more ideas :)