Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkGuD-00CwOB-2r for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 07:21:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkGuC-006eM0-2v for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 07:21:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vkGuC-006eLs-0k for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 07:21:00 +0000 Received: from mail-dy1-x1335.google.com ([2607:f8b0:4864:20::1335]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vkGu8-002LgJ-1t for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 07:20:59 +0000 Received: by mail-dy1-x1335.google.com with SMTP id 5a478bee46e88-2b1981ca515so4543012eec.1 for ; Sun, 25 Jan 2026 23:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769412055; x=1770016855; darn=lists.postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=CoYuJBeh0aQpaA8eTcTVXozx/gEtlxc0JkQccUVzMWw=; b=bv1BR7PqVOZPtof3zkArQWphUL1CTcTnqZvThl0qt1QyryvnaIiMYuZAcIrHVgAwfF do6POVM2KayjFmOcuKdARCMCtyd9ZP2YQBTYibQ6sjR7owCWSA1+g5xq8BvaJZ16cl/T vtVMDsgIHFk2/dKmOrW83kH5kA3j+AogN7g/4RE9iWnd4eWDNfLzKB86+VHcFtD6gc9/ s/Zh0u1PknF1JvpZ1UF/uH012nW5wMkfkWNs0P0z/xUQW+70yy2OIFmxcoHFCvuxA2Y2 OPfgn7WFfex6tvvqMYTKTobbbVzVCXPhuwgJtcfJVfgABZ8wWWielkj/SfjdnUl7/y13 cO0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769412055; x=1770016855; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CoYuJBeh0aQpaA8eTcTVXozx/gEtlxc0JkQccUVzMWw=; b=G7+MQ6w9mm40CrX0+1yK6bOqjuLhMyw3IGVgo+8jiTii2HtGIJgmZ68wXKWqyAZCzc h/2vHrS/2Loq7azW7ZB2dSX430ut1lNsz/5J2XM67NJ/TxpqUBQWGuhVlV/EceaFUZM7 bJXmnH4HxC6ZAPlDsTWVaIabHkKeX1naHXpS1dkfR/mhtbw+p3o32KcohEzJPu0V9UaU rH4f5mOq5tFaXnybdiBBUwReJqXs1sv/xseNu1wC2uuUOWK6IOLZtlEUm/8L6k0Ssowm UB/2LUmR3xz1QpeytP9UCW5Zi5Ajn1InkaSRp69g3PVHi1vHyeuJob/3jTKoFsXi0unx hAPw== X-Gm-Message-State: AOJu0YzBmTW5elQml676pekIkSnqsxba9EoNkdsHjgUwk0FCN6SHDkAS OeJTN0tEY6Ldq11BN7GTutMIIurFsikUWSki5sayUR8AADvR75HqW5nm X-Gm-Gg: AZuq6aLyR2a/0Z0dfy/mSHDPELMibRLwUn2n7DRCZi32dwtetGn6dTUYCl7PXpO8CVm 63hb7ttL/SfH7d5t1LNHXSA06RFP4aPQt8BfaHXELWXOigPofxjexI83oAUvhsleYBBr4wHkgyu d2Fr0vljj+pjVzzJeNOLhlo0wYG06fJpYSUxEGN8Ao/csChahIfr1wZOd9AGcX60mhxJ+tzHFRa 1C15HHbqad7SMgfavv54mixBY64fvtQj8X+W6uW/CbHNKK9TTvW3VmCOHN11ELs2O1PvsNpp2wR 1lIWQ3nj45vnB7PDNwZlEfLxzzr8563KJFSFyhn6fq2ipxhf1KOYfuvMz6NA1WU3PN07sK3iNOi o/rfRrB6/+SclJqrIJpZLaenGywhmDot9RwpdvbS+5Nz6ZEvINDCwQb1ZBjIWseJQyLOv2fu0Jr /Wnl83Y2dCe2i/RpIxmw== X-Received: by 2002:a05:7301:fa0e:b0:2b1:7486:3a06 with SMTP id 5a478bee46e88-2b764345c7bmr1809737eec.18.1769412055452; Sun, 25 Jan 2026 23:20:55 -0800 (PST) Received: from smtpclient.apple ([64.32.14.230]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7410615c0sm10953879eec.0.2026.01.25.23.20.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2026 23:20:54 -0800 (PST) From: Chao Li Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_C469D741-0636-46DE-9D78-1330F6D07673" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.300.41.1.7\)) Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables Date: Mon, 26 Jan 2026 15:20:16 +0800 In-Reply-To: Cc: Postgres hackers , Zsolt Parragi , Amit Kapila To: "David G. Johnston" References: <90F9169D-135C-45E5-8221-4F79DAED98E2@gmail.com> <46DA7611-C18D-4782-AEFF-F861ECDEFA5C@gmail.com> <245AA9F3-7577-46D6-990C-C308A9F36E82@gmail.com> X-Mailer: Apple Mail (2.3864.300.41.1.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_C469D741-0636-46DE-9D78-1330F6D07673 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 26, 2026, at 13:38, David G. Johnston = wrote: >=20 > On Sunday, January 25, 2026, Chao Li wrote: >=20 > How about this: > ``` > > When applied to a partitioned table to rename columns or constraints, > the corresponding partition columns and constraints are renamed > implicitly. ONLY is not allowed, and the command > cannot be used on individual partitions. When the rename target is = the > table name, only the named table is renamed. > > ``` >=20 > =E2=80=A6are renamed implicitly, ONLY is not allowed, and the command = cannot=E2=80=A6(and drop the mention of table renaming). >=20 > Or: >=20 > =E2=80=9CWhen applied to a partitioned table=E2=80=99s name only the = parent is changed, partitions must be renamed separately. However, = column or constraint renaming must be done on the parent without ONLY, = the corresponding partition columns or constraints will be renamed = implicitly.=E2=80=9D >=20 > I find the repeated use of =E2=80=9Ctable=E2=80=9D =E2=80=9Cname(d)=E2=80= =9D and =E2=80=9Crename(d)=E2=80=9D in one sentence worth avoiding. Looks good. I just did a couple of tiny tweaks: * Added a comma between =E2=80=9Ctable=E2=80=99s name=E2=80=9D and = =E2=80=9Conly=E2=80=9D: =E2=80=9Cwhen applied to a partitioned table=E2=80= =99s name, only the parent =E2=80=A6=E2=80=9D * Replaced =E2=80=9Chowever=E2=80=9D with =E2=80=9Cin contrast=E2=80=9D. PFA v8. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_C469D741-0636-46DE-9D78-1330F6D07673 Content-Disposition: attachment; filename=v8-0001-docs-clarify-ALTER-TABLE-behavior-on-partitioned-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v8-0001-docs-clarify-ALTER-TABLE-behavior-on-partitioned-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20e815a3c24ba953f62108565e2ee6691d733b2d65=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Chao=20Li=20=0ADate:=20Wed,=20= 7=20Jan=202026=2014:50:36=20-0700=0ASubject:=20[PATCH=20v8]=20docs:=20= clarify=20ALTER=20TABLE=20behavior=20on=20partitioned=20tables=0A=0A= Document=20how=20individual=20ALTER=20TABLE=20sub-commands=20behave=20= when=20applied=20to=0Apartitioned=20tables.=0A=0AThe=20existing=20ALTER=20= TABLE=20documentation=20provides=20limited=20or=20incomplete=0A= information=20about=20how=20commands=20interact=20with=20partitioned=20= tables,=20leaving=0Ausers=20to=20infer=20behavior=20from=20= experimentation.=20This=20patch=20systematically=0Aclarifies,=20for=20= each=20relevant=20sub-command,=20whether=20changes=20propagate=20to=0A= existing=20partitions,=20can=20be=20applied=20independently=20to=20= partitions,=20and=0Ahow=20the=20ONLY=20keyword=20behaves.=0A=0AIn=20= addition,=20clarify=20in=20CREATE=20TABLE=20documentation=20which=20= parent=20table=0Asettings=20are=20inherited=20by=20newly=20created=20= partitions=20and=20which=20are=20not.=0AThis=20makes=20explicit=20that=20= while=20most=20definition-level=20properties=20are=0Ainherited=20from=20= the=20partitioned=20table,=20certain=20per-relation=20settings=0A(such=20= as=20ownership,=20schema,=20replica=20identity,=20row-level=20security,=20= and=0Aper-attribute=20statistics/options)=20are=20not,=20unless=20= explicitly=20specified.=0A=0ANo=20behavior=20is=20changed=20by=20this=20= patch;=20it=20is=20purely=20a=20documentation=20update=0Aintended=20to=20= make=20existing=20semantics=20explicit=20and=20easier=20to=20understand.=0A= =0AAuthor:=20Chao=20Li=20=0AAuthor:=20David=20G.=20= Johnston=20=0AReviewed-by:=20David=20G.=20= Johnston=20=0AReviewed-by:=20Zsolt=20Parragi=20= =0ADiscussion:=20= https://postgr.es/m/CAEoWx2=3DmYhCfsnHaN96Qqwq5b0GVS2YgO3zpVqPPRd_iO52wRw@= mail.gmail.com=0A---=0A=20doc/src/sgml/ref/alter_table.sgml=20=20|=20320=20= +++++++++++++++++++++--------=0A=20doc/src/sgml/ref/create_table.sgml=20= |=20=20=207=20+=0A=202=20files=20changed,=20237=20insertions(+),=2090=20= deletions(-)=0A=0Adiff=20--git=20a/doc/src/sgml/ref/alter_table.sgml=20= b/doc/src/sgml/ref/alter_table.sgml=0Aindex=201bd479c917a..b3a4f33f446=20= 100644=0A---=20a/doc/src/sgml/ref/alter_table.sgml=0A+++=20= b/doc/src/sgml/ref/alter_table.sgml=0A@@=20-171,6=20+171,12=20@@=20WITH=20= (=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20is=20specified=20and=20a=20column=20already=20exists=20with=20this=20= name,=0A=20=20=20=20=20=20=20no=20error=20is=20thrown.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20the=20column=20is=20added=20to=20the=0A+=20= =20=20=20=20=20partitioned=20table=20definition=20and=20is=20implicitly=20= added=20to=20all=0A+=20=20=20=20=20=20partitions.=20Specifying=20= ONLY=20is=20not=20allowed,=20and=0A+=20=20=20=20=20=20= this=20command=20cannot=20be=20used=20on=20individual=20partitions.=0A+=20= =20=20=20=20=0A=20=20=20=20=20=0A=20=20=20=20= =0A=20=0A@@=20-190,6=20+196,18=20@@=20WITH=20(=20MODULUS=20= numeric_literal,=20REM=0A= =20=20=20=20=20=20=20does=20not=20exist,=20no=20error=20is=20thrown.=20= In=20this=20case=20a=20notice=0A=20=20=20=20=20=20=20is=20issued=20= instead.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20= =20=20=20When=20applied=20to=20a=20partitioned=20table,=20the=20column=20= is=20removed=20from=20the=0A+=20=20=20=20=20=20partitioned=20table=20= definition=20and=20is=20implicitly=20removed=20from=20all=0A+=20=20=20=20= =20=20partitions.=20Specifying=20ONLY=20is=20not=20= allowed,=20and=0A+=20=20=20=20=20=20this=20command=20cannot=20be=20used=20= on=20individual=20partitions.=0A+=20=20=20=20=20=0A+=20=20=20=20=20= =0A+=20=20=20=20=20=20For=20inheritance=20setups,=20a=20descendant=20= column=20is=20removed=20only=20if=20all=20the=0A+=20=20=20=20=20=20= following=20are=20true:=20ONLY=20is=20not=20specified,=20no=20other=20= parent=20defines=20the=0A+=20=20=20=20=20=20column,=20and=20the=20column=20= is=20not=20marked=20as=20having=20been=20independent.=0A+=20=20=20=20=20=20= Otherwise,=20the=20descendant=20column=20is=20instead=20marked=20as=20= having=20been=20independent.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-211,7=20+229,6=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20clause=20must=20be=20provided=20if=20there=20is=20no=20implicit=20= or=20assignment=0A=20=20=20=20=20=20=20cast=20from=20old=20to=20new=20= type.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20=20= =20=20=20=20=20When=20this=20form=20is=20used,=20the=20column's=20= statistics=20are=20removed,=0A=20=20=20=20=20=20=20so=20running=20ANALYZE=0A@@=20-219,6=20= +236,12=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20For=20a=20virtual=20generated=20column,=20= ANALYZE=0A=20=20=20=20=20=20=20is=20not=20necessary=20= because=20such=20columns=20never=20have=20statistics.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20the=20data=20type=20change=20is=20= applied=0A+=20=20=20=20=20=20to=20the=20partitioned=20table=20definition=20= and=20is=20implicitly=20applied=20to=20all=0A+=20=20=20=20=20=20= partitions.=20Specifying=20ONLY=20is=20not=20allowed,=0A= +=20=20=20=20=20=20and=20this=20command=20cannot=20be=20used=20on=20= individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-232,6=20+255,10=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20or=20UPDATE=20commands;=20it=20does=20not=20= cause=20rows=20already=0A=20=20=20=20=20=20=20in=20the=20table=20to=20= change.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20= =20=20=20When=20applied=20to=20a=20partitioned=20table,=20the=20default=20= value=20is=20propagated=0A+=20=20=20=20=20=20to=20all=20partitions=20= unless=20ONLY=20is=20specified.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-242,7=20+269,6=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20These=20forms=20change=20whether=20a=20column=20is=20marked=20to=20= allow=20null=0A=20=20=20=20=20=20=20values=20or=20to=20reject=20null=20= values.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20=20= =20=20=20=20=20SET=20NOT=20NULL=20may=20only=20be=20= applied=20to=20a=20column=0A=20=20=20=20=20=20=20provided=20none=20of=20= the=20records=20in=20the=20table=20contain=20a=0A@@=20-255,18=20+281,18=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20If=20a=20column=20has=20an=20invalid=20not-null=20constraint,=0A=20= =20=20=20=20=20=20SET=20NOT=20NULL=20validates=20it.=0A= =20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A-=20=20=20=20=20= =20If=20this=20table=20is=20a=20partition,=20one=20cannot=20perform=20= DROP=20NOT=20NULL=0A-=20=20=20=20=20=20on=20a=20= column=20if=20it=20is=20marked=20NOT=20NULL=20in=20= the=20parent=0A-=20=20=20=20=20=20table.=20=20To=20drop=20the=20= NOT=20NULL=20constraint=20from=20all=20the=0A-=20=20=20= =20=20=20partitions,=20perform=20DROP=20NOT=20NULL=20= on=20the=20parent=0A-=20=20=20=20=20=20table.=20=20Even=20if=20there=20= is=20no=20NOT=20NULL=20constraint=20on=20the=0A-=20=20= =20=20=20=20parent,=20such=20a=20constraint=20can=20still=20be=20added=20= to=20individual=20partitions,=0A-=20=20=20=20=20=20if=20desired;=20that=20= is,=20the=20children=20can=20disallow=20nulls=20even=20if=20the=20parent=0A= -=20=20=20=20=20=20allows=20them,=20but=20not=20the=20other=20way=20= around.=20=20It=20is=20also=20possible=20to=20drop=0A-=20=20=20=20=20=20= the=20NOT=20NULL=20constraint=20from=20= ONLY=0A-=20=20=20=20=20=20the=20parent=20table,=20= which=20does=20not=20remove=20it=20from=20the=20children.=0A+=20=20=20=20= =20=20If=20this=20table=20is=20a=20partition,=20one=20cannot=20perform=0A= +=20=20=20=20=20=20DROP=20NOT=20NULL=20on=20a=20= column=20if=20it=20is=20marked=0A+=20=20=20=20=20=20NOT=20= NULL=20in=20the=20parent=20table.=20To=20drop=20the=0A+=20=20=20= =20=20=20NOT=20NULL=20constraint=20from=20all=20= partitions,=20perform=0A+=20=20=20=20=20=20DROP=20NOT=20= NULL=20on=20the=20parent=20table.=20Even=20if=20there=20is=0A+=20= =20=20=20=20=20no=20NOT=20NULL=20constraint=20on=20= the=20parent,=20such=20a=0A+=20=20=20=20=20=20constraint=20can=20still=20= be=20added=20to=20individual=20partitions;=20that=20is,=20the=0A+=20=20=20= =20=20=20children=20can=20disallow=20nulls=20even=20if=20the=20parent=20= allows=20them,=20but=20not=0A+=20=20=20=20=20=20the=20other=20way=20= around.=20It=20is=20also=20possible=20to=20apply=0A+=20=20=20=20=20=20= SET=20NOT=20NULL=20or=20DROP=20NOT=20= NULL=20to=0A+=20=20=20=20=20=20ONLY=20the=20= parent=20table.=0A=20=20=20=20=20=20=0A=20=20=20=20=20=0A= =20=20=20=20=0A@@=20-279,7=20+305,6=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20in=20a=20stored=20generated=20column=20is=20rewritten=20and=20all=20= the=20future=20changes=0A=20=20=20=20=20=20=20will=20apply=20the=20new=20= generation=20expression.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20When=20this=20form=20is=20used=20on=20a=20= stored=20generated=20column,=20its=20statistics=0A=20=20=20=20=20=20=20= are=20removed,=20so=20running=0A@@=20-288,6=20+313,11=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20For=20a=20virtual=20generated=20column,=20= ANALYZE=0A=20=20=20=20=20=20=20is=20not=20necessary=20= because=20such=20columns=20never=20have=20statistics.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20the=20generation=20expression=20is=0A+=20= =20=20=20=20=20propagated=20to=20all=20partitions=20unless=20= ONLY=0A+=20=20=20=20=20=20is=20specified.=0A+=20=20=20= =20=20=0A=20=20=20=20=20=0A=20=20=20=20=0A= =20=0A@@=20-299,17=20+329,21=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20Existing=20data=20in=20the=20columns=20is=20retained,=20but=20= future=20changes=20will=20no=0A=20=20=20=20=20=20=20longer=20apply=20the=20= generation=20expression.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20This=20form=20is=20currently=20only=20= supported=20for=20stored=20generated=20columns=20(not=0A=20=20=20=20=20=20= =20virtual=20ones).=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20= =0A=20=20=20=20=20=20=20If=20DROP=20EXPRESSION=20IF=20= EXISTS=20is=20specified=20and=20the=0A=20=20=20=20=20=20=20= column=20is=20not=20a=20generated=20column,=20no=20error=20is=20thrown.=20= =20In=20this=20case=20a=0A=20=20=20=20=20=20=20notice=20is=20issued=20= instead.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20= =20=20=20When=20applied=20to=20a=20partitioned=20table,=20the=20= generation=20expression=20is=0A+=20=20=20=20=20=20dropped=20from=20the=20= partitioned=20table=20definition=20and=20from=20all=0A+=20=20=20=20=20=20= partitions.=20Specifying=20ONLY=20is=20not=20allowed,=20= and=0A+=20=20=20=20=20=20this=20command=20cannot=20be=20used=20on=20= individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-327,12=20+361,17=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20and=20UPDATE=20commands;=20they=20do=20not=20= cause=20rows=0A=20=20=20=20=20=20=20already=20in=20the=20table=20to=20= change.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20=20= =20=20=20=20=20If=20DROP=20IDENTITY=20IF=20EXISTS=20= is=20specified=20and=20the=0A=20=20=20=20=20=20=20column=20is=20not=20an=20= identity=20column,=20no=20error=20is=20thrown.=20=20In=20this=20case=20a=0A= =20=20=20=20=20=20=20notice=20is=20issued=20instead.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20the=20identity=20property=20is=20defined=0A= +=20=20=20=20=20=20on=20the=20partitioned=20table=20and=20is=20applied=20= to=20all=20partitions.=0A+=20=20=20=20=20=20Specifying=20= ONLY=20is=20not=20allowed,=20and=20these=20forms=0A+=20= =20=20=20=20=20cannot=20be=20used=20on=20individual=20partitions.=0A+=20=20= =20=20=20=0A=20=20=20=20=20=0A=20=20=20=20= =0A=20=0A@@=20-346,6=20+385,13=20@@=20WITH=20(=20MODULUS=20= numeric_literal,=20REM=0A= =20=20=20=20=20=20=20supported=20by=20ALTER=20SEQUENCE=20= such=0A=20=20=20=20=20=20=20as=20INCREMENT=20BY.=0A=20= =20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table,=20these=20forms=20alter=20= the=20sequence=0A+=20=20=20=20=20=20associated=20with=20the=20identity=20= column=20on=20the=20partitioned=20table=0A+=20=20=20=20=20=20and=20all=20= individual=20partitions.=20Specifying=20ONLY=0A+=20=20= =20=20=20=20is=20not=20allowed,=20and=20these=20forms=20cannot=20be=20= used=20on=20individual=0A+=20=20=20=20=20=20partitions.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-369,6=20+415,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20SET=20STATISTICS=20acquires=20a=0A=20=20=20=20=20= =20=20SHARE=20UPDATE=20EXCLUSIVE=20lock.=0A=20=20=20=20= =20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20For=20= partitioned=20tables,=20this=20action=20applies=20to=20the=20partitioned=20= table=0A+=20=20=20=20=20=20and=20all=20of=20its=20partitions=20unless=20= ONLY=20is=20specified.=0A+=20=20=20=20=20=0A=20= =20=20=20=20=0A=20=20=20=20=0A=20=0A@@=20= -403,6=20+453,11=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20Changing=20per-attribute=20options=20acquires=20a=0A=20=20=20=20=20= =20=20SHARE=20UPDATE=20EXCLUSIVE=20lock.=0A=20=20=20=20= =20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table=20ONLY=20is=20= implicit,=0A+=20=20=20=20=20=20these=20forms=20must=20be=20applied=20= separately=20to=20the=20partitioned=20table=20and/or=20to=0A+=20=20=20=20= =20=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-437,6=20+492,10=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20during=20future=20table=20updates.=0A=20=20=20=20=20=20=20See=20= =20for=20more=20information.=0A=20=20=20= =20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table,=20the=20storage=20setting=20is=20= propagated=0A+=20=20=20=20=20=20to=20all=20existing=20partitions=20= unless=20ONLY=20is=20specified.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-467,6=20+526,11=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20consulting=20the=20=20setting=0A=20=20=20=20=20=20= =20at=20the=20time=20of=20data=20insertion=20to=20determine=20the=20= method=20to=20use.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A= +=20=20=20=20=20=20When=20applied=20to=20a=20partitioned=20table=20= ONLY=20is=20implicit,=0A+=20=20=20=20=20=20the=20= compression=20method=20must=20be=20applied=20separately=20to=20the=20= partitioned=20table=0A+=20=20=20=20=20=20and/or=20to=20individual=20= partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20=0A=20=20= =20=20=0A=20=0A@@=20-479,7=20+543,6=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20VALID,=20which=20is=20currently=20only=20allowed=20for=20= foreign-key,=0A=20=20=20=20=20=20=20CHECK,=20and=20= not-null=20constraints.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20Normally,=20this=20form=20will=20cause=20= a=20scan=20of=20the=20table=20to=20verify=20that=20all=0A=20=20=20=20=20=20= =20existing=20rows=20in=20the=20table=20satisfy=20the=20new=20= constraint.=20=20But=20if=0A@@=20-495,7=20+558,6=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20See=20=20below=20for=20= more=20information=0A=20=20=20=20=20=20=20about=20using=20the=20= NOT=20VALID=20option.=0A=20=20=20=20=20=20=0A-=0A= =20=20=20=20=20=20=0A=20=20=20=20=20=20=20Although=20most=20forms=20= of=20ADD=0A=20=20=20=20=20=20=20table_constraint=0A@@=20= -506,12=20+568,19=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20referenced=20table,=20in=20addition=20to=20the=20lock=20on=20the=20= table=20on=20which=20the=0A=20=20=20=20=20=20=20constraint=20is=20= declared.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20= =20=20=20=20=20=20Additional=20restrictions=20apply=20when=20unique=20or=20= primary=20key=20constraints=0A=20=20=20=20=20=20=20are=20added=20to=20= partitioned=20tables;=20see=20CREATE=20TABLE.=0A=20= =20=20=20=20=20=0A-=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table,=20the=20constraint=20is=20= added=20to=20the=0A+=20=20=20=20=20=20partitioned=20table=20and=20is=20= implicitly=20added=20to=20all=20partitions.=0A+=20=20=20=20=20=20= Specifying=20ONLY=20is=20not=20allowed.=0A+=20=20=20=20= =20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20For=20= inheritance=20setups,=20the=20constraint=20is=20not=20added=20to=20child=20= tables=20unless=20it=20is=0A+=20=20=20=20=20=20a=20= CHECK=20constraint=20that=20is=20inheritable=20(that=20= is,=20not=20declared=20NO=20INHERIT).=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-523,7=20+592,6=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20constraint=20to=20a=20table=20based=20on=20an=20existing=20unique=20= index.=20=20All=20the=0A=20=20=20=20=20=20=20columns=20of=20the=20index=20= will=20be=20included=20in=20the=20constraint.=0A=20=20=20=20=20=20= =0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20The=20= index=20cannot=20have=20expression=20columns=20nor=20be=20a=20partial=20= index.=0A=20=20=20=20=20=20=20Also,=20it=20must=20be=20a=20b-tree=20= index=20with=20default=20sort=20ordering.=20=20These=0A@@=20-531,7=20= +599,6=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20built=20by=20a=20regular=20ADD=20PRIMARY=20KEY=20= or=20ADD=20UNIQUE=0A=20=20=20=20=20=20=20command.=0A=20= =20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20= =20If=20PRIMARY=20KEY=20is=20specified,=20and=20the=20= index's=20columns=20are=20not=0A=20=20=20=20=20=20=20already=20marked=20= NOT=20NULL,=20then=20this=20command=20will=20attempt=20= to=0A@@=20-539,13=20+606,11=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20That=20requires=20a=20full=20table=20scan=20to=20verify=20the=20= column(s)=20contain=20no=0A=20=20=20=20=20=20=20nulls.=20=20In=20all=20= other=20cases,=20this=20is=20a=20fast=20operation.=0A=20=20=20=20=20=20= =0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20If=20a=20= constraint=20name=20is=20provided=20then=20the=20index=20will=20be=20= renamed=20to=20match=0A=20=20=20=20=20=20=20the=20constraint=20name.=20=20= Otherwise=20the=20constraint=20will=20be=20named=20the=20same=20as=0A=20=20= =20=20=20=20=20the=20index.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20= =20=20=0A=20=20=20=20=20=20=20After=20this=20command=20is=20= executed,=20the=20index=20is=20owned=20by=20the=0A=20=20=20= =20=20=20=20constraint,=20in=20the=20same=20way=20as=20if=20the=20index=20= had=20been=20built=20by=0A@@=20-553,11=20+618,10=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20command.=20=20In=20particular,=20dropping=20the=20constraint=20= will=20make=20the=20index=0A=20=20=20=20=20=20=20disappear=20too.=0A=20=20= =20=20=20=20=0A-=0A=20=20=20=20=20=20=0A-=20=20=20=20=20=20= This=20form=20is=20not=20currently=20supported=20on=20partitioned=20= tables.=0A+=20=20=20=20=20=20This=20form=20is=20not=20supported=20on=20= partitioned=20tables,=20but=20can=20be=20used=20on=0A+=20=20=20=20=20=20= individual=20partitions.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20Adding=20= a=20constraint=20using=20an=20existing=20index=20can=20be=20helpful=20in=0A= @@=20-578,6=20+642,12=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20created.=20Currently=20only=20foreign=20key=20constraints=20may=20= be=20altered=20in=0A=20=20=20=20=20=20=20this=20fashion,=20but=20see=20= below.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20= =20=20When=20applied=20to=20a=20partitioned=20table,=20the=20constraint=20= is=20altered=20on=20the=0A+=20=20=20=20=20=20partitioned=20table=20= definition=20and=20implicitly=20applied=20to=20all=20partitions.=0A+=20=20= =20=20=20=20Specifying=20ONLY=20is=20not=20allowed,=20= and=20this=20command=0A+=20=20=20=20=20=20cannot=20be=20used=20on=20= individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-596,7=20+666,11=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20non-inheritable=20on=20a=20table=20with=20children,=20then=20the=20= corresponding=0A=20=20=20=20=20=20=20constraint=20on=20children=20will=20= be=20marked=20as=20no=20longer=20inherited,=0A=20=20=20=20=20=20=20but=20= not=20removed.=0A-=20=20=20=20=20=20=0A+=20=20=20=20=20=0A= +=20=20=20=20=20=0A+=20=20=20=20=20=20These=20forms=20are=20not=20= supported=20on=20partitioned=20tables,=20but=20can=20be=20used=0A+=20=20=20= =20=20=20on=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20= =20=20=20=20=0A=20=20=20=20=20=0A=20=0A@@=20= -615,6=20+689,13=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20This=20command=20acquires=20a=20= SHARE=20UPDATE=20EXCLUSIVE=20lock.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20the=20constraint=20is=20validated=20on=20= the=0A+=20=20=20=20=20=20partitioned=20table=20and=20on=20all=20= partitions.=20Unlike=20most=20constraint-related=0A+=20=20=20=20=20=20= sub-commands,=20individual=20partitions=20may=20validate=20the=20= constraint=0A+=20=20=20=20=20=20independently=20of=20the=20partitioned=20= table,=20so=20long=20as=20the=20partitioned=0A+=20=20=20=20=20=20table=20= itself=20is=20not=20yet=20validated.=0A+=20=20=20=20=20=0A=20=20=20= =20=20=0A=20=20=20=20=0A=20=0A@@=20-627,6=20= +708,11=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20If=20IF=20EXISTS=20is=20specified=20and=20the=20= constraint=0A=20=20=20=20=20=20=20does=20not=20exist,=20no=20error=20is=20= thrown.=20In=20this=20case=20a=20notice=20is=20issued=20instead.=0A=20=20= =20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table,=20the=20constraint=20is=20= dropped=20from=0A+=20=20=20=20=20=20all=20existing=20partitions=20unless=20= ONLY=20is=20specified.=0A+=20=20=20=20=20=20Dropping=20= an=20inherited=20constaint=20from=20an=20individual=20partition=20is=20= not=20allowed.=0A+=20=20=20=20=20=0A=20=20=20=20=20=0A=20= =20=20=20=0A=20=0A@@=20-648,7=20+734,6=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20of=20course=20the=20integrity=20of=20the=20constraint=20cannot=20= be=20guaranteed=20if=20the=0A=20=20=20=20=20=20=20triggers=20are=20not=20= executed.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A=20= =20=20=20=20=20=20The=20trigger=20firing=20mechanism=20is=20also=20= affected=20by=20the=20configuration=0A=20=20=20=20=20=20=20variable=20= .=20Simply=20enabled=0A= @@=20-658,7=20+743,6=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20mode,=20and=20triggers=20configured=20as=20ENABLE=20= ALWAYS=20will=0A=20=20=20=20=20=20=20fire=20regardless=20of=20= the=20current=20replication=20role.=0A=20=20=20=20=20=20=0A-=0A=20= =20=20=20=20=20=0A=20=20=20=20=20=20=20The=20effect=20of=20this=20= mechanism=20is=20that=20in=20the=20default=20configuration,=0A=20=20=20=20= =20=20=20triggers=20do=20not=20fire=20on=20replicas.=20=20This=20is=20= useful=20because=20if=20a=20trigger=0A@@=20-670,13=20+754,15=20@@=20WITH=20= (=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20to=20ENABLE=20ALWAYS=20so=20that=20it=20is=20= also=20fired=20on=0A=20=20=20=20=20=20=20replicas.=0A=20=20=20=20=20=20= =0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20When=20= this=20command=20is=20applied=20to=20a=20partitioned=20table,=20the=20= states=20of=0A-=20=20=20=20=20=20corresponding=20clone=20triggers=20in=20= the=20partitions=20are=20updated=20too,=0A-=20=20=20=20=20=20unless=20= ONLY=20is=20specified.=0A+=20=20=20=20=20=20= corresponding=20clone=20triggers=20are=20updated=20too,=20unless=20= ONLY=0A+=20=20=20=20=20=20is=20specified.=0A+=20=20=20= =20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20For=20= inheritance=20setups=20ONLY=20is=20implied,=20though=20= it=20may=0A+=20=20=20=20=20=20be=20specified.=0A=20=20=20=20=20=20= =0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20This=20= command=20acquires=20a=20SHARE=20ROW=20EXCLUSIVE=20= lock.=0A=20=20=20=20=20=20=0A@@=20-694,12=20+780,16=20@@=20WITH=20= (=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20are=20always=20applied=20in=20order=20to=20keep=20views=20working=20= even=20if=20the=20current=0A=20=20=20=20=20=20=20session=20is=20in=20a=20= non-default=20replication=20role.=0A=20=20=20=20=20=20=0A-=0A=20=20= =20=20=20=20=0A=20=20=20=20=20=20=20The=20rule=20firing=20= mechanism=20is=20also=20affected=20by=20the=20configuration=20variable=0A= =20=20=20=20=20=20=20,=20= analogous=20to=20triggers=20as=0A=20=20=20=20=20=20=20described=20above.=0A= =20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table=20ONLY=20= is=20implicit,=0A+=20=20=20=20=20=20these=20forms=20must=20be=20applied=20= separately=20to=20the=20partitioned=20table=0A+=20=20=20=20=20=20and/or=20= to=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-715,6=20+805,11=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20See=20also=0A=20=20=20=20=20=20=20CREATE=20POLICY.=0A= =20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table=20ONLY=20= is=20implicit,=0A+=20=20=20=20=20=20these=20forms=20must=20be=20applied=20= separately=20to=20the=20partitioned=20table=20and/or=20to=0A+=20=20=20=20= =20=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-730,6=20+825,11=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20See=20also=0A=20=20=20=20=20=20=20CREATE=20POLICY.=0A= =20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table=20ONLY=20= is=20implicit,=0A+=20=20=20=20=20=20this=20form=20must=20be=20applied=20= separately=20to=20the=20partitioned=20table=20and/or=20to=0A+=20=20=20=20= =20=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-744,6=20+844,10=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20Changing=20cluster=20options=20acquires=20= a=20SHARE=20UPDATE=20EXCLUSIVE=20lock.=0A=20=20=20=20=20= =20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20This=20form=20= is=20not=20supported=20on=20partitioned=20tables,=20but=20can=20be=20= used=20on=0A+=20=20=20=20=20=20individual=20partitions.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-759,6=20+863,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20Changing=20cluster=20options=20acquires=20= a=20SHARE=20UPDATE=20EXCLUSIVE=20lock.=0A=20=20=20=20=20= =20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20This=20form=20= is=20not=20supported=20on=20partitioned=20tables,=20but=20can=20be=20= used=20on=0A+=20=20=20=20=20=20individual=20partitions.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-786,11=20+894,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table,=20there=20is=20no=20data=20to=20= rewrite,=0A-=20=20=20=20=20=20but=20partitions=20created=20afterwards=20= will=20default=20to=20the=20given=20access=0A-=20=20=20=20=20=20method=20= unless=20overridden=20by=20a=20USING=20clause.=0A-=20=20= =20=20=20=20Specifying=20DEFAULT=20removes=20a=20= previous=20value,=0A-=20=20=20=20=20=20causing=20future=20partitions=20= to=20default=20to=0A-=20=20=20=20=20=20= default_table_access_method.=0A+=20=20=20=20=20=20= only=20the=20default=20for=20newly=20created=20partitions=20is=20= changed.=0A+=20=20=20=20=20=20Specifying=20DEFAULT=20= removes=20a=20previously=20set=20access=20method,=0A+=20=20=20=20=20=20= causing=20future=20partitions=20to=20use=20= default_table_access_method.=0A+=20=20=20=20=20=20= Individual=20partitions=20are=20affected=20just=20like=20any=20other=20= regular=20table.=0A=20=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A@@=20-803,12=20+910,9=20@@=20= WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20moves=20the=20data=20file(s)=20associated=20with=20the=20table=20= to=20the=20new=20tablespace.=0A=20=20=20=20=20=20=20Indexes=20on=20the=20= table,=20if=20any,=20are=20not=20moved;=20but=20they=20can=20be=20moved=0A= =20=20=20=20=20=20=20separately=20with=20additional=20SET=20= TABLESPACE=20commands.=0A-=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table,=20nothing=20is=20moved,=20but=20any=0A-=20=20= =20=20=20=20partitions=20created=20afterwards=20with=0A-=20=20=20=20=20=20= CREATE=20TABLE=20PARTITION=20OF=20will=20use=20that=20= tablespace,=0A-=20=20=20=20=20=20unless=20overridden=20by=20a=20= TABLESPACE=20clause.=0A+=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table,=20no=20data=20is=20moved,=20only=20= the=20default=0A+=20=20=20=20=20=20for=20newly=20created=20partitions=20= is=20changed.=0A=20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A= =20=20=20=20=20=20=20All=20tables=20in=20the=20current=20database=20in=20= a=20tablespace=20can=20be=20moved=20by=20using=0A=20=20=20=20=20=20=20= the=20ALL=20IN=20TABLESPACE=20form,=20which=20will=20= lock=20all=20tables=0A@@=20-835,15=20+939,14=20@@=20WITH=20(=20MODULUS=20= numeric_literal,=20REM=0A= =20=20=20=20=20=20=20(see=20).=20=20It=20cannot=20be=20applied=0A= =20=20=20=20=20=20=20to=20a=20temporary=20table.=0A=20=20=20=20=20=20= =0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20This=20= also=20changes=20the=20persistence=20of=20any=20sequences=20linked=20to=20= the=20table=0A=20=20=20=20=20=20=20(for=20identity=20or=20serial=20= columns).=20=20However,=20it=20is=20also=20possible=20to=0A=20=20=20=20=20= =20=20change=20the=20persistence=20of=20such=20sequences=20separately.=0A= =20=20=20=20=20=20=0A-=0A=20=20=20=20=20=20=0A-=20=20=20=20=20= =20This=20form=20is=20not=20supported=20for=20partitioned=20tables.=0A+=20= =20=20=20=20=20This=20form=20is=20not=20supported=20on=20partitioned=20= tables,=20but=20can=20be=20used=20on=0A+=20=20=20=20=20=20individual=20= partitions.=0A=20=20=20=20=20=20=0A=20=20=20=20=20=0A=20= =20=20=20=0A@@=20-865,12=20+968,15=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20time=20the=20table=20is=20locked=20so=20currently=20executing=20= queries=20will=20not=20be=0A=20=20=20=20=20=20=20affected.=0A=20=20=20=20= =20=20=0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20= SHARE=20UPDATE=20EXCLUSIVE=20lock=20will=20be=20taken=20= for=0A=20=20=20=20=20=20=20fillfactor,=20TOAST=20and=20autovacuum=20= storage=20parameters,=20as=20well=20as=20the=0A=20=20=20=20=20=20=20= planner=20parameter=20parallel_workers.=0A=20=20=20=20= =20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20This=20form=20= is=20not=20supported=20on=20partitioned=20tables,=20but=20can=20be=20= used=20on=0A+=20=20=20=20=20=20individual=20partitions.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-882,6=20+988,11=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20defaults.=20=20As=20with=20SET,=20a=20table=20= rewrite=20might=20be=0A=20=20=20=20=20=20=20needed=20to=20update=20the=20= table=20entirely.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A= +=20=20=20=20=20=20When=20applied=20to=20a=20partitioned=20table,=20this=20= form=20is=20accepted=20but=20has=20no=0A+=20=20=20=20=20=20practical=20= effect.=20=20It=20can=20be=20used=20on=20individual=20partitions,=20= where=20it=0A+=20=20=20=20=20=20behaves=20as=20for=20a=20regular=20= table.=0A+=20=20=20=20=20=0A=20=20=20=20=20=0A=20=20=20= =20=0A=20=0A@@=20-895,7=20+1006,6=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20already=20contain=20all=20the=20same=20columns=20as=20the=20parent=20= (it=20could=20have=0A=20=20=20=20=20=20=20additional=20columns,=20too).=20= =20The=20columns=20must=20have=20matching=20data=20types.=0A=20=20=20=20=20= =20=0A-=0A=20=20=20=20=20=20=0A=20=20=20=20=20=20=20In=20= addition,=20all=20CHECK=20and=20NOT=20= NULL=0A=20=20=20=20=20=20=20constraints=20on=20the=20parent=20= must=20also=20exist=20on=20the=20child,=20except=20those=0A@@=20-907,6=20= +1017,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20FOREIGN=20KEY=20constraints=20are=20not=20= considered,=20but=0A=20=20=20=20=20=20=20this=20might=20change=20in=20= the=20future.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20= =20=20=20=20=20This=20form=20does=20not=20support=20partitioned=20= tables;=20it=20cannot=20be=20applied=20to=0A+=20=20=20=20=20=20either=20= a=20partitioned=20table=20or=20its=20partitions.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= @@=20-919,6=20+1033,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20Queries=20against=20the=20parent=20table=20will=20no=20longer=20= include=20records=20drawn=0A=20=20=20=20=20=20=20from=20the=20target=20= table.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20= =20=20This=20form=20does=20not=20support=20partitioned=20tables;=20it=20= cannot=20be=20applied=20to=0A+=20=20=20=20=20=20either=20a=20partitioned=20= table=20or=20its=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-933,6=20+1051,10=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20that=20CREATE=20TABLE=20OF=20would=20permit=20= an=20equivalent=20table=0A=20=20=20=20=20=20=20definition.=0A=20=20=20=20= =20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20= applied=20to=20a=20partitioned=20table=20ONLY=20is=20= implicit,=0A+=20=20=20=20=20=20and=20this=20form=20cannot=20be=20used=20= on=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20= =0A=20=20=20=20=0A=20=0A@@=20-942,6=20+1064,10=20= @@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=0A=20=20=20=20=20=20=20This=20form=20dissociates=20a=20typed=20= table=20from=20its=20type.=0A=20=20=20=20=20=20=0A+=20=20=20=20=20= =0A+=20=20=20=20=20=20When=20applied=20to=20a=20partitioned=20= table=20ONLY=20is=20implicit,=0A+=20=20=20=20=20=20= and=20this=20form=20cannot=20be=20used=20on=20individual=20partitions.=0A= +=20=20=20=20=20=0A=20=20=20=20=20=0A=20=20=20=20= =0A=20=0A@@=20-952,6=20+1078,11=20@@=20WITH=20(=20MODULUS=20= numeric_literal,=20REM=0A= =20=20=20=20=20=20=20This=20form=20changes=20the=20owner=20of=20the=20= table,=20sequence,=20view,=20materialized=20view,=0A=20=20=20=20=20=20=20= or=20foreign=20table=20to=20the=20specified=20user.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table=20ONLY=20is=20implicit,=0A= +=20=20=20=20=20=20this=20form=20must=20be=20applied=20separately=20to=20= the=20partitioned=20table=20and/or=20to=0A+=20=20=20=20=20=20individual=20= partitions.=0A+=20=20=20=20=20=0A=20=20=20=20=20=0A=20=20= =20=20=0A=20=0A@@=20-1008,6=20+1139,12=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20=20=0A=20=20=20=20=20=20=20=0A=20=20=20=20= =20=20=0A+=0A+=20=20=20=20=20=0A+=20=20=20=20= =20=20When=20applied=20to=20a=20partitioned=20table=20= ONLY=20is=20implicit,=0A+=20=20=20=20=20=20this=20= form=20must=20be=20applied=20independently=20to=20the=20partitioned=20= table=20and/or=0A+=20=20=20=20=20=20to=20individual=20partitions.=0A+=20=20= =20=20=20=0A=20=20=20=20=20=0A=20=20=20=20= =0A=20=0A@@=20-1022,6=20+1159,18=20@@=20WITH=20(=20= MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20the=20index=20is=20renamed=20as=20well.=0A=20=20=20=20=20=20=20= There=20is=20no=20effect=20on=20the=20stored=20data.=0A=20=20=20=20=20=20= =0A+=20=20=20=20=20=0A+=20=20=20=20=20=20When=20applied=20= to=20a=20partitioned=20table=E2=80=99s=20name,=20only=20the=20parent=20= is=20changed,=0A+=20=20=20=20=20=20partitions=20must=20be=20renamed=20= separately.=20=20In=20contrast,=20column=20or=20constraint=0A+=20=20=20=20= =20=20renaming=20must=20be=20done=20on=20the=20parent=20without=20= ONLY,=20the=0A+=20=20=20=20=20=20corresponding=20= partition=20columns=20or=20constraints=20will=20be=20renamed=20= implicitly.=0A+=20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20= =20=20=20For=20inheritance=20setups,=20the=20behavior=20described=20for=20= partitioned=20tables=20applies=0A+=20=20=20=20=20=20only=20to=20the=20= dependent=20column(s)=20on=20the=20descendant=20table(s).=20=20It=20is=20= always=0A+=20=20=20=20=20=20allowed=20to=20target=20a=20descendant=20= table=20with=20column=20altering=20commands=20on=20independent=0A+=20=20=20= =20=20=20columns.=0A+=20=20=20=20=20=0A=20=20=20=20=20=0A= =20=20=20=20=0A=20=0A@@=20-1032,6=20+1181,11=20@@=20WITH=20= (=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20This=20form=20moves=20the=20table=20into=20another=20schema.=20=20= Associated=20indexes,=0A=20=20=20=20=20=20=20constraints,=20and=20= sequences=20owned=20by=20table=20columns=20are=20moved=20as=20well.=0A=20= =20=20=20=20=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20applied=20to=20a=20partitioned=20table=20ONLY=20= is=20implicit,=0A+=20=20=20=20=20=20this=20form=20must=20be=20applied=20= independently=20to=20the=20partitioned=20table=20and/or=0A+=20=20=20=20=20= =20to=20individual=20partitions.=0A+=20=20=20=20=20=0A=20=20=20=20= =20=0A=20=20=20=20=0A=20=0A@@=20-1410,6=20= +1564,27=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20=20=20*=20can=20be=20specified=20after=20the=20= table=20name=20to=20explicitly=0A=20=20=20=20=20=20=20=20=20indicate=20= that=20descendant=20tables=20are=20included.=0A=20=20=20=20=20=20=20=20= =0A+=0A+=20=20=20=20=20=20=20=0A+=20=20=20=20=20=20=20=20= For=20a=20table=20that=20uses=20table=20inheritance,=20descendant=20= tables=20are=20those=0A+=20=20=20=20=20=20=20=20that=20inherit=20from=20= the=20named=20table,=20directly=20or=20indirectly.=0A+=20=20=20=20=20=20=20= =20For=20a=20partitioned=20table,=20descendant=20tables=20are=20its=20= partitions.=0A+=20=20=20=20=20=20=20=0A+=0A+=20=20=20=20=20=20=20= =0A+=20=20=20=20=20=20=20=20Note=20that=20for=20partitioned=20= tables,=20ONLY=20does=20not=20control=0A+=20=20=20=20=20= =20=20=20recursion=20for=20all=20ALTER=20TABLE=20= actions.=20Some=20actions=0A+=20=20=20=20=20=20=20=20apply=20only=20to=20= the=20partitioned=20table=20itself,=20regardless=20of=20whether=0A+=20=20= =20=20=20=20=20=20ONLY=20is=20specified,=20while=20= others=20are=20propagated=20to=0A+=20=20=20=20=20=20=20=20partitions.=20= The=20exact=20behavior=20depends=20on=20the=20specific=20action=20being=0A= +=20=20=20=20=20=20=20=20performed.=0A+=20=20=20=20=20=20=20=0A+=0A= +=20=20=20=20=20=20=20=0A+=20=20=20=20=20=20=20=20Users=20should=20= consult=20the=20documentation=20of=20each=20individual=0A+=20=20=20=20=20= =20=20=20ALTER=20TABLE=20action=20to=20determine=20= whether=20and=20how=20it=0A+=20=20=20=20=20=20=20=20affects=20= partitions.=0A+=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20= =0A=20=20=20=20=20=20=0A=20=0A@@=20-1768,45=20= +1943,10=20@@=20WITH=20(=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20= =0A=20=0A=20=20=20=20=0A-=20=20=20=20If=20a=20table=20has=20= any=20descendant=20tables,=20it=20is=20not=20permitted=20to=20add,=0A-=20= =20=20=20rename,=20or=20change=20the=20type=20of=20a=20column=20in=20the=20= parent=20table=20without=20doing=0A-=20=20=20=20the=20same=20to=20the=20= descendants.=20=20This=20ensures=20that=20the=20descendants=20always=0A-=20= =20=20=20have=20columns=20matching=20the=20parent.=20=20Similarly,=20a=20= CHECK=0A-=20=20=20=20constraint=20cannot=20be=20= renamed=20in=20the=20parent=20without=20also=20renaming=20it=20in=0A-=20=20= =20=20all=20descendants,=20so=20that=20CHECK=20= constraints=20also=20match=0A-=20=20=20=20between=20the=20parent=20and=20= its=20descendants.=20=20(That=20restriction=20does=20not=20apply=0A-=20=20= =20=20to=20index-based=20constraints,=20however.)=0A-=20=20=20=20Also,=20= because=20selecting=20from=20the=20parent=20also=20selects=20from=20its=20= descendants,=0A-=20=20=20=20a=20constraint=20on=20the=20parent=20cannot=20= be=20marked=20valid=20unless=20it=20is=20also=20marked=0A-=20=20=20=20= valid=20for=20those=20descendants.=20=20In=20all=20of=20these=20cases,=20= ALTER=20TABLE=0A-=20=20=20=20ONLY=20will=20be=20= rejected.=0A-=20=20=20=0A-=0A-=20=20=20=0A-=20=20=20=20A=20= recursive=20DROP=20COLUMN=20operation=20will=20remove=20= a=0A-=20=20=20=20descendant=20table's=20column=20only=20if=20the=20= descendant=20does=20not=20inherit=0A-=20=20=20=20that=20column=20from=20= any=20other=20parents=20and=20never=20had=20an=20independent=0A-=20=20=20= =20definition=20of=20the=20column.=20=20A=20nonrecursive=20DROP=0A= -=20=20=20=20COLUMN=20(i.e.,=20ALTER=20TABLE=20ONLY=20= ...=20DROP=0A-=20=20=20=20COLUMN)=20never=20removes=20any=20= descendant=20columns,=20but=0A-=20=20=20=20instead=20marks=20them=20as=20= independently=20defined=20rather=20than=20inherited.=0A-=20=20=20=20A=20= nonrecursive=20DROP=20COLUMN=20command=20will=20fail=20= for=20a=0A-=20=20=20=20partitioned=20table,=20because=20all=20partitions=20= of=20a=20table=20must=20have=20the=20same=0A-=20=20=20=20columns=20as=20= the=20partitioning=20root.=0A-=20=20=20=0A-=0A-=20=20=20=0A= -=20=20=20=20The=20actions=20for=20identity=20columns=20(ADD=0A= -=20=20=20=20GENERATED,=20SET=20etc.,=20= DROP=0A-=20=20=20=20IDENTITY),=20as=20well=20as=20the=20= actions=0A-=20=20=20=20CLUSTER,=20= OWNER,=0A-=20=20=20=20and=20= TABLESPACE=20never=20recurse=20to=20descendant=20= tables;=0A-=20=20=20=20that=20is,=20they=20always=20act=20as=20though=20= ONLY=20were=20specified.=0A-=20=20=20=20Actions=20= affecting=20trigger=20states=20recurse=20to=20partitions=20of=20= partitioned=0A-=20=20=20=20tables=20(unless=20ONLY=20= is=20specified),=20but=20never=20to=0A-=20=20=20=20= traditional-inheritance=20descendants.=0A-=20=20=20=20Adding=20a=20= constraint=20recurses=20only=20for=20CHECK=20= constraints=0A-=20=20=20=20that=20are=20not=20marked=20NO=20= INHERIT.=0A+=20=20=20=20For=20inheritance=20setups,=20the=20= behavior=20described=20for=20partitioned=20tables=20applies=0A+=20=20=20=20= only=20to=20the=20dependent=20column(s)=20on=20the=20descendant=20= table(s).=20=20It=20is=20always=0A+=20=20=20=20allowed=20to=20target=20a=20= descendant=20table=20with=20column=20altering=20commands=20on=20= independent=0A+=20=20=20=20columns.=0A=20=20=20=20=0A=20=0A=20=20=20= =20=0Adiff=20--git=20a/doc/src/sgml/ref/create_table.sgml=20= b/doc/src/sgml/ref/create_table.sgml=0Aindex=2077c5a763d45..2fcab0d874e=20= 100644=0A---=20a/doc/src/sgml/ref/create_table.sgml=0A+++=20= b/doc/src/sgml/ref/create_table.sgml=0A@@=20-633,6=20+633,13=20@@=20WITH=20= (=20MODULUS=20numeric_literal,=20REM=0A=20=20=20=20=20= =20=20concurrent=20operations=20on=20the=20partitioned=20table.=0A=20=20=20= =20=20=20=0A=20=0A+=20=20=20=20=20=0A+=20=20=20=20=20=20= When=20a=20partition=20is=20created,=20it=20inherits=20many=20of=20the=20= properties=0A+=20=20=20=20=20=20of=20the=20parent=20table.=20=20However,=20= properties=20related=20to=20ownership,=0A+=20=20=20=20=20=20schema,=20= replica=20identity,=20row-level=20security=20configuration,=0A+=20=20=20=20= =20=20per-attribute=20statistics=20targets,=20and=20per-attribute=20= options=0A+=20=20=20=20=20=20are=20not=20inherited.=0A+=20=20=20=20=20= =0A=20=20=20=20=20=0A=20=20=20=20=0A=20=0A= --=20=0A2.50.1=20(Apple=20Git-155)=0A=0A= --Apple-Mail=_C469D741-0636-46DE-9D78-1330F6D07673--