Thread: pgsql: Prevent a backend crash when processing CREATE TABLE commands

pgsql: Prevent a backend crash when processing CREATE TABLE commands

From
neilc@svr1.postgresql.org (Neil Conway)
Date:
Log Message:
-----------
Prevent a backend crash when processing CREATE TABLE commands with
more than 65K columns, or when the created table has more than 65K columns
due to adding inherited columns from parent relations. Fix a similar
crash when processing SELECT queries with more than 65K target list
entries. In all three cases we would eventually detect the error and
elog, but the check was being made too late.

Modified Files:
--------------
    pgsql/src/backend/commands:
        tablecmds.c (r1.139 -> r1.140)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.139&r2=1.140)
    pgsql/src/backend/parser:
        analyze.c (r1.312 -> r1.313)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.312&r2=1.313)