Search code examples
jdbcpostgresql-9.1postgresql-9.3squirrel-sql

squirrelsql doesn't like query_to_xml


I am using an SQL that includes query_to_xml:

select query_to_xml('select 1+1 answer', true, true, '') as_xml;

When any SQL with query_to_xml is executed in Squirrel SQL it will result in:

|      as_xml        |
+--------------------+
|<UnknownType (2009)>|

With the same JDBC driver, credentials and a Java class the SQL will result in the expected XML output:

|                          as_xml                            | 
+------------------------------------------------------------+
| <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">|
|                                                            |
|   <answer>2</answer>                                       |
| </row>                                                     |

I can execute other functions in Squirrel and they will respond, like select version().

Is this a known feature in Squirrel?


Solution

  • If you are using the latest squirrel client, Go to File, Global Preferences-> Data Type Controls, check the box under Unknown DataTypes section. Rerun the query, it might work.