Re: What does this error message mean? - Mailing list pgsql-general

From Tom Lane
Subject Re: What does this error message mean?
Date
Msg-id 30952.1384741204@sss.pgh.pa.us
Whole thread Raw
In response to What does this error message mean?  (Ken Tanzer <ken.tanzer@gmail.com>)
Responses Re: What does this error message mean?
List pgsql-general
Ken Tanzer <ken.tanzer@gmail.com> writes:
> Hi.  I got an error message reported to me that I've never seen before, and
> I'm not quite sure what it means or what would cause it.

> ERROR:  type of parameter 70 (text) does not match that when preparing the
> plan (unknown) CONTEXT: PL/pgSQL function
> generate_payments(date,text,integer,integer) line 195 at assignment

I think this must mean that you changed the schema of table tbl_payment
during this session, and then re-ran the function.  plpgsql isn't as good
as it could be about dealing with intra-session changes of composite
types.  The reference to "parameter 70" seems a bit odd though, it doesn't
seem like you have anywhere near 70 variables in that function ...

> (And BTW, how exactly is that line number counted? Does the "CREATE
> FUNCTION" statement count as line 1?

In recent versions, the opening quote of the function's body string counts
as line 1.  If your attachment came through without extra wrapping, I'm
counting this as line 195:

        pay_test.comment=payment.comment;

(thinks about it for a bit)  Actually it seems more likely that a change
in the rowtype of "payment" caused this, ie some change in the output
column set of that "final_query" query.  Difficult to guess more than
that without more context.

            regards, tom lane


pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Postgres as In-Memory Database?
Next
From: Tony Theodore
Date:
Subject: Re: Composite types or composite keys?