Re: "Number of columns exceed limit" on a hierarchy of views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Waller <daw138a-postgres(at)yahoo(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "Number of columns exceed limit" on a hierarchy of views
Date: 2009-08-21 13:44:58
Message-ID: 2760.1250862298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Waller <daw138a-postgres(at)yahoo(dot)co(dot)uk> writes:
> I'm struggling with a database query that under some circumstances returns the error "ERROR: number of columns (2053) exceeds limit (1664)". Confusingly, though, no table is that wide.

This limit would be enforced against the output rows of any intermediate
join step. Without looking at EXPLAIN plans it's hard to say exactly
what's biting you, but it doesn't surprise me a a whole lot that joining
multiple 500-column tables would get you into trouble. I'd suggest
reconsidering your table schemas. Array columns might help.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-08-21 13:56:52 Re: "ownership" of sequences, pseudo random unique id
Previous Message Adrian Klaver 2009-08-21 13:44:43 Re: Questions about encoding between two databases