Whole record returned in stead of field

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Whole record returned in stead of field
Date: 2013-10-03 08:08:59
Message-ID: CAGZ55DT2AzVxCy5vgx37-hP9ax9UeHAHauQEFX+HEoTGnm2BsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The table definition:

CREATE TABLE isi.isi_l1_publication
(
article_id character varying(15),
journal_id character varying(7),
volume character varying(10),
issue character varying(10),
publication_year character varying(4),
publication_date character varying(20),
id bigint NOT NULL DEFAULT nextval('isi.pubtmp_id_seq'::regclass),
CONSTRAINT publ_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);

A simple select works as expected:

select article_id, publication_year from isi.isi_l1_publication where
article_id='000088352400014':

"000088352400014";"2000"

But this query (which works on a development computer):

WITH UTS AS (select art_id
from isi.art_country_link
where countrycode = 'ZA'
INTERSECT
select art_id
from isi.art_country_link
where
countrycode = 'CH')
SELECT A.article_id, A publication_year
from isi.isi_l1_publication A,
UTS B,
isi.ritem C
where B.art_id = A.article_id
and A.publication_year <= '2012'
and A.publication_year >= '2000'
and C.ut = B.art_id
and C.dt ='@ Article'
order by A.publication_year;

delivers this result on the server:

"000166055700014";"(000166055700014,35528J0,40,1-2,2000,DEC,2316393)"
"000088352400014";"(000088352400014,12927J0,39,6,2000,JUN,30510144)"
"000166477400015";"(000166477400015,10233J0,11,4,2000,DEC,2530188)"
....

I have seen it once before and could not figured out what is causing it.

Version: Postgresql 9.1

I would like to know...

Regards
Johann

--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Johann Spies 2013-10-03 08:18:19 Re: Whole record returned in stead of field
Previous Message saritha N 2013-10-03 07:35:12 Unable to convert xpath value to date