ERROR: return and sql tuple descriptions are incompatible

From: M Sarwar <sarwarmd02(at)outlook(dot)com>
To: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: ERROR: return and sql tuple descriptions are incompatible
Date: 2024-03-05 17:17:22
Message-ID: DM4PR19MB597886696589C5CE33F5D58AD3222@DM4PR19MB5978.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello All,

I am trying to run the below SQL.
SELECT * FROM CROSSTAB (
'SELECT
PART.SERIAL_NUMBER ,
TESTC.TEST_NUMBER,
TRESULT.TEST_RESULT
FROM BRONXdev.TEST_PART_DETAILS_ALL_MCM PART,
BRONXDEV.TEST_RESULTS_ALL_MCM TRESULT,
BRONXDEV.TEST_TEST_DETAILS_ALL_MCM TESTC
WHERE PART.TEST_PART_DET_ALL_MCM_ID = TRESULT.TEST_PART_DETAILS_ALL_MCM_ID
AND TRESULT.TEST_TEST_DETAILS_ALL_MCM_ID = TESTC.TEST_TEST_DETAILS_ALL_MCM_ID
AND PART.DATE1 = ''12/01/2023''
and PART.STAGE = ''BI''
AND TESTC.TEST_NUMBER = ''TEST1P2''
ORDER BY 1, 2'
)
AS Concatenated ( SERIAL_NUMBER character varying(18), TEST_NUMBER character(10), TEST_RESULT NUMERIC )
;
I am getting the below error message.

ERROR: return and sql tuple descriptions are incompatible
SQL state: 42601

I followed the link, https://stackoverflow.com/questions/22052334/postgresql-says-return-and-sql-tuple-descriptions-are-incompatible <https://stackoverflow.com/questions/22052334/postgresql-says-return-and-sql-tuple-descriptions-are-incompatible> and that is not helping!

I have tried to change the data type SERIAL_NUMBER , TEST_NUMBER and TEST_RESULT and that did not help.
Appreciate any help in this regard.

Thanks,
Sarwar

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Erik Wienhold 2024-03-05 18:06:57 Re: ERROR: return and sql tuple descriptions are incompatible
Previous Message Domen Šetar 2024-03-04 07:27:16 RE: Logical replication from standby