JOIN column maximum

From: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: JOIN column maximum
Date: 2012-01-05 23:11:11
Message-ID: CANnCtn+eJC9sp8go0J5eaeWO7cdsC9e3t18vB+A9ajx_fR53Mw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How is the number of columns in a join determined? When I combine somewhere
around 90 tables in a JOIN, the query returns:

ERROR: joins can have at most 32767 columns
SQL state: 54000

I'm sure most people will say "Why the hell are you joining 90 tables."
I've asked this list before for advice on how to work with the
approximately 23,000 column American Community Survey dataset, and based on
previous responses I am trying to combine 117 "sequences" (basically
vertical partitions of the dataset) into one table using array columns. Of
course, I can build this up by joining a few tables at a time, so the
question is mostly curiosity, but I haven't been able to find this
documented anywhere. Moreover, the 32767 limit doesn't map to any
immediately intuitive transformation of 90, like squaring (which is much
too low) or factorial (which is much to high).

Any insight?

Regards,
--Lee

--
Lee Hachadoorian
PhD, Earth & Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-01-05 23:18:13 Re: JOIN column maximum
Previous Message Shawn Eckley 2012-01-05 22:50:46 Re: Need Help : PostgreSQL Installation on Windows 7 64 bit