Re: large XML data type appears empty when doing a select

Поиск
Список
Период
Сортировка
От René Romero Benavides
Тема Re: large XML data type appears empty when doing a select
Дата
Msg-id 4F119E9B.9010609@gmail.com
обсуждение исходный текст
Ответ на large XML data type appears empty when doing a select  (Paula Price <paula.price@issinc.com>)
Ответы Re: large XML data type appears empty when doing a select  (René Romero Benavides <ichbinrene@gmail.com>)
Список pgsql-novice
El 12/01/2012 12:58 p.m., Paula Price escribió:

Postgresql 9.0.5 on Red Hat/Linux

In the table described below, the report xml contains xml (DOCUMENT) that ranges in size from 31KB to 518KB.  When I do ‘select reportxml from somereportxml where reportkey = ‘silly’;’ the terminal screen appears blank with ‘more’ displayed on the bottom.  The data is in the database – verified using EMS SQL Studio for PostgreSQL – but does not show up using pgadmin3 or typing the Select statement from the terminal screen.  Any ideas?

CREATE TABLE somereportxml

(

  reportkey character varying(36) NOT NULL DEFAULT uuid_generate_v1(),

  objectname character varying(200) NOT NULL,

  reportxml xml NOT NULL,

  recordtimestamp timestamp(2) with time zone NOT NULL DEFAULT now(),

   CONSTRAINT pkey_somereportxml PRIMARY KEY (reportkey )

)

WITH (

  OIDS=FALSE

);

 

Paula Price

 

Maybe it has to do with this:

8.13.2. Encoding Handling

Care must be taken when dealing with multiple character encodings on the client, server, and in the XML data passed through them. When using the text mode to pass queries to the server and query results to the client (which is the normal mode), PostgreSQL converts all character data passed between the client and the server and vice versa to the character encoding of the respective end; see Section 22.2
http://www.postgresql.org/docs/9.0/static/datatype-xml.html

Or maybe with this
"An alternative solution for comparing XML values is to convert them to character strings first, but note that character string comparison has little to do with a useful XML comparison method."
 
So try casting reportxml to varchar

Greetings!

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Postgres V9.1 - unix socket directory Ubuntu /tmp vs /var/run/postgres
Следующее
От: René Romero Benavides
Дата:
Сообщение: Re: large XML data type appears empty when doing a select