Hi Folks, The following query appears to be correct but fails to execute.
\set VERBOSITY verbose select * from crosstab('select claim_id::bigint, patient_id::integer, code_id::text from diagnosis') as dg_list(claim_id bigint, patient_id integer, code_id text); ERROR: 42601: return and sql tuple descriptions are incompatible LOCATION: crosstab, tablefunc.c:445 The above query works if patient_id is cast to text. The claim_id as bigint works too. postgres 9.2.4 openSUSE 12.3 (x86_64) VERSION = 12.3 diagnosis --------------+--------------+------------------------------------------------------------------- id | integer | not null default nextval('diagnosis_id_seq'::regclass) patient_id | integer | not null code_id | text | not null claim_id | bigint | seq_num | smallint | poa_indicator | character(1) | Thanks for your time and help. Carl Clemens The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient of this message, please contact the sender and delete this material from this computer.