JOIN column maximum - Mailing list pgsql-general

From Lee Hachadoorian
Subject JOIN column maximum
Date
Msg-id CANnCtn+eJC9sp8go0J5eaeWO7cdsC9e3t18vB+A9ajx_fR53Mw@mail.gmail.com
Whole thread Raw
Responses Re: JOIN column maximum  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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/

pgsql-general by date:

Previous
From: Shawn Eckley
Date:
Subject: Re: Need Help : PostgreSQL Installation on Windows 7 64 bit
Next
From: Tom Lane
Date:
Subject: Re: JOIN column maximum