Re: ERROR: return and sql tuple descriptions are incompatible - Mailing list pgsql-admin

From Erik Wienhold
Subject Re: ERROR: return and sql tuple descriptions are incompatible
Date
Msg-id vulsb3n6dcd7wzjuhslppt3oij3nkwqh2olagmx2ibtnjzpccu@7c2jvcyjm2x2
Whole thread Raw
In response to ERROR: return and sql tuple descriptions are incompatible  (M Sarwar <sarwarmd02@outlook.com>)
Responses Re: ERROR: return and sql tuple descriptions are incompatible
List pgsql-admin
On 2024-05-04 20:01 +0200, M Sarwar wrote:
> SELECT *
> 
>  FROM CROSSTAB (
> 
> '
> 
> SELECT
> 
>                                 PART.SERIAL_NUMBER,
> 
>         TESTC.TEST_NUMBER,
> 
>                                 TRESULT.TEST_RESULT
> 
> FROM      bronx.TEST_PART_DETAILS_ALL_MCM_INIT PART,
> 
>                                 bronx.TEST_RESULTS_ALL_MCM_INIT TRESULT,
> 
>                                 bronx.TEST_TEST_DETAILS_ALL_MCM_INIT 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.STAGE
                               = ''FT''
 
> 
>                AND SPLIT_PART (SERIAL_NUMBER, '':'', 1 )
   = ''B7307631''
 
> 
>                 And TESTC.TEST_NUMBER
        = ''TEST1P1''
 
> 
> ORDER BY PART.SERIAL_NUMBER , TESTC.TEST_NUMBER
> 
> '
> 
> )  as ConcatenatedResults (
> 
>
         SERIALNUMBER  character varying ,
 
> 
> TEST1P1  character
> 
> --              TEST_RESULT numeric
> 
> );
> 
> 
> 
> Error Encountered:
> 
> ERROR: return and sql tuple descriptions are incompatible SQL state: 42601

The output value columns (TEST1P1 and TEST_RESULT) must be of the same
type.  And it must be the same type as the third result column
(TRESULT.TEST_RESULT).

-- 
Erik



pgsql-admin by date:

Previous
From: M Sarwar
Date:
Subject: ERROR: return and sql tuple descriptions are incompatible
Next
From: M Sarwar
Date:
Subject: Re: ERROR: return and sql tuple descriptions are incompatible