Re: field error on refreshed materialized view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: field error on refreshed materialized view
Date: 2024-01-27 21:27:09
Message-ID: 1408869.1706390829@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Nolan <htfoot(at)gmail(dot)com> writes:
> Followup: The problem turned out to be a field in the mysql server
> that was not size-limited to 255 characters and had several rows with
> as many as 299 characters in them. Apparently when using an FDW and
> materialized view in postgresql 10.4, field size limits aren't
> checked, because a query on the matview in the 10.4 system finds those
> records with more than 255 characters in that field.

> So, not a character encoding issue at all.

Hm ... if the foreign table's field was declared as varchar(255),
older PG might've believed that and not rechecked the length while
storing into the matview. Not sure if this behavior change was
intentional or an accidental product of refactoring.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-01-28 18:36:58 Query performance in 9.6.24 vs 14.10
Previous Message Michael Nolan 2024-01-27 20:28:43 Re: field error on refreshed materialized view