OSDN Git Service

Don't allow CREATE TABLE AS to create a column with invalid collation
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 4 Mar 2011 21:39:44 +0000 (23:39 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 4 Mar 2011 21:42:07 +0000 (23:42 +0200)
commitb9cff97fdf486eca7e563a9696a7391048814d0f
tree842d92d0efcf3e0fa8118b9a47160e0ad9075da1
parent8d3b421f5f7b955e7ac7d156aa74ee6a6fe4e9f6
Don't allow CREATE TABLE AS to create a column with invalid collation

It is possible that an expression ends up with a collatable type but
without a collation.  CREATE TABLE AS could then create a table based
on that.  But such a column cannot be dumped with valid SQL syntax, so
we disallow creating such a column.

per test report from Noah Misch
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/commands/tablecmds.c
src/include/catalog/heap.h
src/test/regress/expected/collate.linux.utf8.out
src/test/regress/sql/collate.linux.utf8.sql