PDA

View Full Version : QtSql strange results after postgres stored function call



golubevsv
15th October 2014, 10:36
Hello. My program using postgresql database. I've migrated from Qt4 to Qt5, everything it's ok, but calling database stored functions, that returns Postgres "character varying" always returns empty string. Calling this function in CLI (psql) returns correct cyrillic string. Performing direct select-queries to database tables, containing cyrillic fields also returns correct cyrillic strings.

Also, calling all of stored functions thas return strings (even consists from latin characters) - returns an empty string.

wysota
15th October 2014, 10:45
Are there any threads involved?

golubevsv
15th October 2014, 10:50
No, this is usual GUI single-threaded application.

wysota
15th October 2014, 12:08
Can we see some actual code?

golubevsv
16th October 2014, 13:05
Thanks, i've found reason. I am using named parameters and bindValue of QSqlQuery. In my database tables and functions names look like "prefix$object_name". Escaping $ symbol fully solves the problem. Is it correct behaviour? I am not mixing named and positional parameters,