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 1w0DdD-001ih1-3B for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 07:05:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0DdA-007c73-1f for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 07:05:21 +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 1w0Dd9-007c6u-2V for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 07:05:20 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0Dd4-00000001ZSn-3t5K for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 07:05:19 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-35a09e0dd63so88527a91.3 for ; Wed, 11 Mar 2026 00:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773212714; x=1773817514; 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=k+Oh7zAKFcgjjN8AabDzhQi7893jl+t4albXz6J5kUA=; b=OrUtLVYbdPQWXGsK8FwNXh229shOGqY5rxi7/FINiuD+mmyyGS3FJX5vfvxcviDkGs 71VGx3Ocxbn9GR+VdBr5pxqhN142tbOO8hDG1y+10rqgCPFkncsztcciJtV2PfbjmIKh e0jPOJREmK/iLZnRXiBDENQLokZOF29HaXJLz+E+i9QU3pGWfgAabq7Q4CNJe/0grEdc NcTbvjQz3bvpVRTYYxlp/fnlLHIbT28WfLbS6WcESylxvVyfZtxmvWa27I6U73zLgDkq b/X6cjocyRvC3qF2OEs/EeDmrNMjvaDaGIntjG9eSPMyswaTCtY1ri3b8Nq23t1qP5Rc mBmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773212714; x=1773817514; 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=k+Oh7zAKFcgjjN8AabDzhQi7893jl+t4albXz6J5kUA=; b=Gn0SWgITBDsQ3GAbm0hXKSeB+abpFSy59smUd82hjA8v2/RbLujEwlchZ2z0FcAgE4 V/PzNr5mh16B2gGTE9idr3rzcrMootVhCe/7StzjWInpcezsU5xGbtGCFwwOgqjr6fFH DboS3VOc/11LuugXg6rcfbk9tqyPHg5d2zs7yU3RT5g2qHnCFTKnRelq72SwBjaQdiVk d2oc6/KiMka7HFUT8wSLJjWO7IIqtK45UJp6EEfePl0JxssAI2aS5y1yaHS09jTK/E16 Pr1nYG23H1WgNDzhYaRDK+oKurtfNYXPOSQViARnbL3PTYaXxG3fsZHoh7TuwDvM+7l3 rzXA== X-Forwarded-Encrypted: i=1; AJvYcCWoRIGlV6y0T2jWiCTzT9U0RetSQwlz3zWna2BRpWpibLK9ZK5WTrrM87b4oykbMkHbf2/WDT3OjFSXoGu1@lists.postgresql.org X-Gm-Message-State: AOJu0Yzd7W2VCHz1t6UGgjxWPQWjg8wsiSrrHZ21vnkLC1500LREZwL+ GIi/VrYsJ2IzeKt+LSeTT20OqCIPfwhAnmDigxFX9WBaHwS1TGKUm1+i X-Gm-Gg: ATEYQzxiOOvF0XQTptyE3OuiZTASmWEZ4K3j5GrWfDVUQ5JP82dC+VPTWei9NzItbTE IZg7fBmlf+i/y+zxI9kH3G57+uq9WWFnOl5UjjD34qAsmeDATgE4GMs6tujtFvMqNwQX1L3zI/R J95SZaeURUMx6vZQ7BN9lQvmNHxH8mgzmXcn7hq7zl8FopbinX7oc650Xuhmr6Nc2miRbYVRYJ+ 6CHqJjhztJULEYzrYtFUaHL+o5NbYMbYcLSAjgCFERR2ozfetPYbwvXy8VWzoh4yZPsHNR2SXgK aO3JYsE+lS3kc/wDQRn4BkwxGAIkBFh08FRowCeMfeK7cF12pobSsIsPy37WJ3R7+LxTmlJI3Zc HBiHauw368Xg8CggZRPcjgasjTKmlVopyR+6M0RXvaJ7wE46ufOqjo4/X35bYgvoTnZSb7E6jAS xCCqqiheGe4KOUA/HIZ3hqxuErM5EmI5Dj X-Received: by 2002:a17:90b:1d09:b0:359:849a:7357 with SMTP id 98e67ed59e1d1-35a01285234mr1439127a91.20.1773212713784; Wed, 11 Mar 2026 00:05:13 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a02fca40bsm1531868a91.10.2026.03.11.00.05.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2026 00:05:12 -0700 (PDT) From: Chao Li Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_73264C59-D5EA-4B6F-B6AA-F4B2C81131D6" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: ALTER TABLE: warn when actions do not recurse to partitions Date: Wed, 11 Mar 2026 15:04:34 +0800 In-Reply-To: Cc: Jim Jones , "David G. Johnston" , Postgres hackers To: Greg Sabino Mullane References: <6eff5e43-cacd-4a2a-ad1d-e3b313c86050@uni-muenster.de> <950BB7B5-0180-4C36-82A0-7E17B920F740@gmail.com> <8ECD9403-F0BB-4971-94CF-2709EEB4E3B9@gmail.com> <9174F0CF-2F70-4B4F-AED4-CAF113B7F093@gmail.com> <14669a83-c7b4-4cdf-890c-dceecd025ee1@uni-muenster.de> <3F59D90E-9A47-4C1C-B330-D62D668A462E@gmail.com> <5e01263a-1994-44d5-9e98-7212acf9c985@uni-muenster.de> X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_73264C59-D5EA-4B6F-B6AA-F4B2C81131D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 10, 2026, at 23:32, Greg Sabino Mullane = wrote: >=20 > Review of v6: Thank you very much for the review. >=20 > typedef struct partitionNoRecurseNotice > { > List *notices; > } partitionNoRecurseNotice; > Not sure why we need a struct here, rather than just passing the list = around? Initially I thought there might be a few fields in the structure, but = ended up only one List field. Yes, this structure is not needed now. = Removed it in v7. >=20 > Also should be PartitionNoRecurseNotice (CamelCase) >=20 > foreach(cell, postNotice->notices) > { > if (strcmp((char *) lfirst(cell), notice_msg) = =3D=3D 0) > { > pfree(notice_msg); > found =3D true; > break; > } > } >=20 > This seems a lot of extra work that could be avoided. Since we know = each message is unique to the cmdtype/AlterTableType and the = rel/Relation combination, use those two to drive the duplicate check. = Then we can only build the notice_msg if needed! Perhaps adding two more = fields to that lonely struct above? Are you concerning that rendering the full message text is the extra = work? This is not a hot path, so I don=E2=80=99t think that would be a = big deal. Actually, adding two more fields sounds more expensive. >=20 > partitionNoRecurseNotice * postNotice); >=20 > postNotice is a little misleading - maybe pending_notices or just = notices? Yes, =E2=80=9Cpending=E2=80=9D makes sense. Updated in v7. >=20 > does not affect present partitions >=20 > s/present/existing/g > CollectPartitionNoRecurseNotice(AT_SetSchema, rel, = stmt->relation->inh, false, &postNotice); >=20 > This hard-coded AT_SetSchema just to return a "SET SCHEMA" later on = feels hacky. Don't have a workaround off the top of my head, just = registering my mild unease. :)=20 Yes, as SET SCHEMA doesn=E2=80=99t go through the standard ALTER TABLE = process: AlterTable() -> ATController() -> ATPrepCmd(). If you get some idea, please let me know. >=20 > /* Emit a notice only if there are partitions */ > if (nparts =3D=3D 0) > return; >=20 > It doesn't look like this particular case is tested. Other than that, = the tests look very good. Good catch. Added a test case to cover that. PFA v7: addressed Greg=E2=80=99s review comments. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_73264C59-D5EA-4B6F-B6AA-F4B2C81131D6 Content-Disposition: attachment; filename=v7-0001-ALTER-TABLE-emit-NOTICE-when-ONLY-is-omitted-but-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v7-0001-ALTER-TABLE-emit-NOTICE-when-ONLY-is-omitted-but-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20e09d8d71015f379ede75dc9fbc280ff45137a6bd=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Chao=20Li=20(Evan)"=20=0A= Date:=20Mon,=2012=20Jan=202026=2016:56:58=20+0800=0ASubject:=20[PATCH=20= v7]=20ALTER=20TABLE:=20emit=20NOTICE=20when=20ONLY=20is=20omitted=20but=20= no=0A=20partition=20recursion=20occurs=0A=0ASome=20ALTER=20TABLE=20= sub-commands=20do=20not=20recurse=20to=20partitions=20even=20when=20ONLY=0A= is=20not=20specified=20on=20a=20partitioned=20table.=20=20This=20can=20= be=20surprising,=20since=0Athe=20default=20expectation=20is=20that=20= commands=20propagate=20to=20all=20partitions.=0A=0AEmit=20a=20NOTICE=20= in=20such=20cases=20to=20make=20the=20behavior=20explicit,=20and=20= advise=20how=0Ato=20suppress=20the=20message=20or=20modify=20partitions=20= individually.=0A=0AAffected=20sub-commands=20include:=0A=20=20-=20ALTER=20= COLUMN=20SET/RESET=20attribute_option=0A=20=20-=20ALTER=20COLUMN=20SET=20= COMPRESSION=0A=20=20-=20ENABLE/DISABLE=20RULE=0A=20=20-=20= ENABLE/DISABLE/FORCE/NO=20FORCE=20ROW=20LEVEL=20SECURITY=0A=20=20-=20= REPLICA=20IDENTITY=0A=20=20-=20OWNER=20TO=0A=20=20-=20SET=20TABLESPACE=0A= =20=20-=20SET=20SCHEMA=0A=0ARENAME=20is=20intentionally=20excluded.=20= Using=20ONLY=20(or=20not)=20has=20no=20effect=20for=0ARENAME,=20since=20= relation=20names=20are=20independent=20by=20nature=20and=20there=20is=20= no=0Aexpectation=20of=20recursion.=0A=0AOF=20/=20NOT=20OF=20are=20also=20= excluded.=20Using=20ONLY=20has=20no=20effect=20for=20these=0Acommands,=20= as=20they=20apply=20only=20to=20the=20partitioned=20table=20itself=20and=20= not=20to=0Aits=20partitions.=0A=0ARegression=20tests=20are=20updated=20= to=20use=20ONLY=20where=20appropriate.=0A=0AAuthor:=20Chao=20Li=20= =0AReviewed-by:=20David=20G.=20Johnston=20= =0AReviewed-by:=20Greg=20Sabino=20Mullane=20= =0AReviewed-by:=20Jim=20Jones=20= =0ADiscussion:=20= https://postgr.es/m/CAEoWx2=3DSLga-xH09Cq_PAvsHhQHrBK+V0vF821JKgzS=3DBm0ha= A@mail.gmail.com=0A---=0A=20src/backend/commands/tablecmds.c=20=20=20=20=20= =20=20=20=20=20=20=20=20=20|=20138=20++++++++++++++++--=0A=20= src/include/nodes/parsenodes.h=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=20=201=20+=0A=20src/test/regress/expected/alter_table.out=20=20=20= =20=20|=20=2084=20++++++++++-=0A=20src/test/regress/expected/cluster.out=20= =20=20=20=20=20=20=20=20|=20=20=202=20+-=0A=20= src/test/regress/expected/merge.out=20=20=20=20=20=20=20=20=20=20=20|=20=20= =204=20+-=0A=20src/test/regress/expected/partition_merge.out=20|=20=20=20= 2=20+-=0A=20src/test/regress/expected/partition_split.out=20|=20=20=202=20= +-=0A=20src/test/regress/expected/privileges.out=20=20=20=20=20=20|=20=20= =202=20+-=0A=20src/test/regress/expected/rowsecurity.out=20=20=20=20=20|=20= =20=204=20+-=0A=20src/test/regress/expected/tablespace.out=20=20=20=20=20= =20|=20=20=204=20+-=0A=20src/test/regress/expected/update.out=20=20=20=20= =20=20=20=20=20=20|=20=20=202=20+-=0A=20= src/test/regress/expected/vacuum.out=20=20=20=20=20=20=20=20=20=20|=20=20= =206=20+-=0A=20src/test/regress/sql/alter_table.sql=20=20=20=20=20=20=20=20= =20=20|=20=2064=20+++++++-=0A=20src/test/regress/sql/cluster.sql=20=20=20= =20=20=20=20=20=20=20=20=20=20=20|=20=20=202=20+-=0A=20= src/test/regress/sql/merge.sql=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=20=204=20+-=0A=20src/test/regress/sql/partition_merge.sql=20=20=20= =20=20=20|=20=20=202=20+-=0A=20src/test/regress/sql/partition_split.sql=20= =20=20=20=20=20|=20=20=202=20+-=0A=20src/test/regress/sql/privileges.sql=20= =20=20=20=20=20=20=20=20=20=20|=20=20=202=20+-=0A=20= src/test/regress/sql/rowsecurity.sql=20=20=20=20=20=20=20=20=20=20|=20=20= =204=20+-=0A=20src/test/regress/sql/tablespace.sql=20=20=20=20=20=20=20=20= =20=20=20|=20=20=204=20+-=0A=20src/test/regress/sql/update.sql=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20|=20=20=202=20+-=0A=20= src/test/regress/sql/vacuum.sql=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=20=20=206=20+-=0A=2022=20files=20changed,=20300=20insertions(+),=20= 43=20deletions(-)=0A=0Adiff=20--git=20a/src/backend/commands/tablecmds.c=20= b/src/backend/commands/tablecmds.c=0Aindex=2085242dcc245..1e8ebde43e1=20= 100644=0A---=20a/src/backend/commands/tablecmds.c=0A+++=20= b/src/backend/commands/tablecmds.c=0A@@=20-461,7=20+461,8=20@@=20static=20= void=20ATController(AlterTableStmt=20*parsetree,=0A=20=09=09=09=09=09=09=20= AlterTableUtilityContext=20*context);=0A=20static=20void=20= ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20AlterTableCmd=20*cmd,=0A=20= =09=09=09=09=09=20=20bool=20recurse,=20bool=20recursing,=20LOCKMODE=20= lockmode,=0A-=09=09=09=09=09=20=20AlterTableUtilityContext=20*context);=0A= +=09=09=09=09=09=20=20AlterTableUtilityContext=20*context,=0A+=09=09=09=09= =09=20=20List=20**pendingNotice);=0A=20static=20void=20= ATRewriteCatalogs(List=20**wqueue,=20LOCKMODE=20lockmode,=0A=20=09=09=09=09= =09=09=09=20=20AlterTableUtilityContext=20*context);=0A=20static=20void=20= ATExecCmd(List=20**wqueue,=20AlteredTableInfo=20*tab,=0A@@=20-745,6=20= +746,10=20@@=20static=20void=20ATExecMergePartitions(List=20**wqueue,=20= AlteredTableInfo=20*tab,=20Relation=0A=20static=20void=20= ATExecSplitPartition(List=20**wqueue,=20AlteredTableInfo=20*tab,=0A=20=09= =09=09=09=09=09=09=09=20Relation=20rel,=20PartitionCmd=20*cmd,=0A=20=09=09= =09=09=09=09=09=09=20AlterTableUtilityContext=20*context);=0A+static=20= void=20CollectPartitionNoRecurseNotice(AlterTableType=20cmdtype,=20= Relation=20rel,=0A+=09=09=09=09=09=09=09=09=09=09=09bool=20recurse,=20= bool=20recursing,=0A+=09=09=09=09=09=09=09=09=09=09=09List=20= **pendingNotice);=0A+static=20void=20EmitPartitionNoRecurseNotice(List=20= *pendingNotice);=0A=20=0A=20/*=20= ----------------------------------------------------------------=0A=20=20= *=09=09DefineRelation=0A@@=20-4886,13=20+4891,14=20@@=20= ATController(AlterTableStmt=20*parsetree,=0A=20{=0A=20=09List=09=20=20=20= *wqueue=20=3D=20NIL;=0A=20=09ListCell=20=20=20*lcmd;=0A+=09List=09=20=20=20= *pendingNotice=20=3D=20NIL;=0A=20=0A=20=09/*=20Phase=201:=20preliminary=20= examination=20of=20commands,=20create=20work=20queue=20*/=0A=20=09= foreach(lcmd,=20cmds)=0A=20=09{=0A=20=09=09AlterTableCmd=20*cmd=20=3D=20= (AlterTableCmd=20*)=20lfirst(lcmd);=0A=20=0A-=09=09ATPrepCmd(&wqueue,=20= rel,=20cmd,=20recurse,=20false,=20lockmode,=20context);=0A+=09=09= ATPrepCmd(&wqueue,=20rel,=20cmd,=20recurse,=20false,=20lockmode,=20= context,=20&pendingNotice);=0A=20=09}=0A=20=0A=20=09/*=20Close=20the=20= relation,=20but=20keep=20lock=20until=20commit=20*/=0A@@=20-4903,6=20= +4909,9=20@@=20ATController(AlterTableStmt=20*parsetree,=0A=20=0A=20=09= /*=20Phase=203:=20scan/rewrite=20tables=20as=20needed,=20and=20run=20= afterStmts=20*/=0A=20=09ATRewriteTables(parsetree,=20&wqueue,=20= lockmode,=20context);=0A+=0A+=09/*=20Emit=20post-notice=20for=20= partitions=20that=20were=20not=20recursed=20into.=20*/=0A+=09= EmitPartitionNoRecurseNotice(pendingNotice);=0A=20}=0A=20=0A=20/*=0A@@=20= -4917,7=20+4926,8=20@@=20ATController(AlterTableStmt=20*parsetree,=0A=20= static=20void=0A=20ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20= AlterTableCmd=20*cmd,=0A=20=09=09=20=20bool=20recurse,=20bool=20= recursing,=20LOCKMODE=20lockmode,=0A-=09=09=20=20= AlterTableUtilityContext=20*context)=0A+=09=09=20=20= AlterTableUtilityContext=20*context,=0A+=09=09=20=20List=20= **pendingNotice)=0A=20{=0A=20=09AlteredTableInfo=20*tab;=0A=20=09= AlterTablePass=20pass=20=3D=20AT_PASS_UNSET;=0A@@=20-5066,6=20+5076,8=20= @@=20ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20AlterTableCmd=20= *cmd,=0A=20=09=09=09=09=09=09=09=09ATT_MATVIEW=20|=20ATT_FOREIGN_TABLE);=0A= =20=09=09=09/*=20This=20command=20never=20recurses=20*/=0A=20=09=09=09= pass=20=3D=20AT_PASS_MISC;=0A+=09=09=09/*=20Emit=20a=20notice=20if=20= needed=20*/=0A+=09=09=09CollectPartitionNoRecurseNotice(cmd->subtype,=20= rel,=20recurse,=20recursing,=20pendingNotice);=0A=20=09=09=09break;=0A=20= =09=09case=20AT_SetStorage:=09=09/*=20ALTER=20COLUMN=20SET=20STORAGE=20= */=0A=20=09=09=09ATSimplePermissions(cmd->subtype,=20rel,=0A@@=20-5081,6=20= +5093,8=20@@=20ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20= AlterTableCmd=20*cmd,=0A=20=09=09=09/*=20This=20command=20never=20= recurses=20*/=0A=20=09=09=09/*=20No=20command-specific=20prep=20needed=20= */=0A=20=09=09=09pass=20=3D=20AT_PASS_MISC;=0A+=09=09=09/*=20Emit=20a=20= notice=20if=20needed=20*/=0A+=09=09=09= CollectPartitionNoRecurseNotice(cmd->subtype,=20rel,=20recurse,=20= recursing,=20pendingNotice);=0A=20=09=09=09break;=0A=20=09=09case=20= AT_DropColumn:=09=09/*=20DROP=20COLUMN=20*/=0A=20=09=09=09= ATSimplePermissions(cmd->subtype,=20rel,=0A@@=20-5148,6=20+5162,8=20@@=20= ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20AlterTableCmd=20*cmd,=0A=20= =09=09=09/*=20This=20command=20never=20recurses=20*/=0A=20=09=09=09/*=20= No=20command-specific=20prep=20needed=20*/=0A=20=09=09=09pass=20=3D=20= AT_PASS_MISC;=0A+=09=09=09/*=20Emit=20a=20notice=20if=20needed=20*/=0A+=09= =09=09CollectPartitionNoRecurseNotice(cmd->subtype,=20rel,=20recurse,=20= recursing,=20pendingNotice);=0A=20=09=09=09break;=0A=20=09=09case=20= AT_ClusterOn:=09=09/*=20CLUSTER=20ON=20*/=0A=20=09=09case=20= AT_DropCluster:=09/*=20SET=20WITHOUT=20CLUSTER=20*/=0A@@=20-5191,6=20= +5207,8=20@@=20ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20= AlterTableCmd=20*cmd,=0A=20=09=09=09/*=20This=20command=20never=20= recurses=20*/=0A=20=09=09=09ATPrepSetTableSpace(tab,=20rel,=20cmd->name,=20= lockmode);=0A=20=09=09=09pass=20=3D=20AT_PASS_MISC;=09/*=20doesn't=20= actually=20matter=20*/=0A+=09=09=09/*=20Emit=20a=20notice=20if=20needed=20= */=0A+=09=09=09CollectPartitionNoRecurseNotice(cmd->subtype,=20rel,=20= recurse,=20recursing,=20pendingNotice);=0A=20=09=09=09break;=0A=20=09=09= case=20AT_SetRelOptions:=09/*=20SET=20(...)=20*/=0A=20=09=09case=20= AT_ResetRelOptions:=09/*=20RESET=20(...)=20*/=0A@@=20-5200,6=20+5218,7=20= @@=20ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20AlterTableCmd=20= *cmd,=0A=20=09=09=09=09=09=09=09=09ATT_MATVIEW=20|=20ATT_INDEX);=0A=20=09= =09=09/*=20This=20command=20never=20recurses=20*/=0A=20=09=09=09/*=20No=20= command-specific=20prep=20needed=20*/=0A+=09=09=09/*=20It=20will=20check=20= for=20partitioned=20table=20at=20exec=20time=20*/=0A=20=09=09=09pass=20=3D= =20AT_PASS_MISC;=0A=20=09=09=09break;=0A=20=09=09case=20AT_AddInherit:=09= =09/*=20INHERIT=20*/=0A@@=20-5237,8=20+5256,8=20@@=20ATPrepCmd(List=20= **wqueue,=20Relation=20rel,=20AlterTableCmd=20*cmd,=0A=20=09=09=09= ATSimplePermissions(cmd->subtype,=20rel,=0A=20=09=09=09=09=09=09=09=09= ATT_TABLE=20|=20ATT_PARTITIONED_TABLE=20|=20ATT_MATVIEW);=0A=20=09=09=09= pass=20=3D=20AT_PASS_MISC;=0A-=09=09=09/*=20This=20command=20never=20= recurses=20*/=0A-=09=09=09/*=20No=20command-specific=20prep=20needed=20= */=0A+=09=09=09/*=20This=20command=20doesn't=20recurse=20to=20= partitions,=20so=20notice=20if=20needed=20*/=0A+=09=09=09= CollectPartitionNoRecurseNotice(cmd->subtype,=20rel,=20recurse,=20= recursing,=20pendingNotice);=0A=20=09=09=09break;=0A=20=09=09case=20= AT_EnableTrig:=09=09/*=20ENABLE=20TRIGGER=20variants=20*/=0A=20=09=09= case=20AT_EnableAlwaysTrig:=0A@@=20-5259,17=20+5278,30=20@@=20= ATPrepCmd(List=20**wqueue,=20Relation=20rel,=20AlterTableCmd=20*cmd,=0A=20= =09=09case=20AT_EnableAlwaysRule:=0A=20=09=09case=20= AT_EnableReplicaRule:=0A=20=09=09case=20AT_DisableRule:=0A-=09=09case=20= AT_AddOf:=09=09=09/*=20OF=20*/=0A-=09=09case=20AT_DropOf:=09=09=09/*=20= NOT=20OF=20*/=0A-=09=09case=20AT_EnableRowSecurity:=0A+=09=09case=20= AT_EnableRowSecurity:=09/*=20ENABLE/DISABLE=20ROW=20SECURITY=20variants=20= */=0A=20=09=09case=20AT_DisableRowSecurity:=0A-=09=09case=20= AT_ForceRowSecurity:=0A+=09=09case=20AT_ForceRowSecurity:=09/*=20= FORCE/NO=20FORCE=20ROW=20SECURITY=20variants=20*/=0A=20=09=09case=20= AT_NoForceRowSecurity:=0A=20=09=09=09ATSimplePermissions(cmd->subtype,=20= rel,=0A=20=09=09=09=09=09=09=09=09ATT_TABLE=20|=20= ATT_PARTITIONED_TABLE);=0A=20=09=09=09/*=20These=20commands=20never=20= recurse=20*/=0A=20=09=09=09/*=20No=20command-specific=20prep=20needed=20= */=0A=20=09=09=09pass=20=3D=20AT_PASS_MISC;=0A+=09=09=09/*=20Emit=20a=20= notice=20if=20needed=20*/=0A+=09=09=09= CollectPartitionNoRecurseNotice(cmd->subtype,=20rel,=20recurse,=20= recursing,=20pendingNotice);=0A+=09=09=09break;=0A+=09=09case=20= AT_AddOf:=09=09=09/*=20OF=20*/=0A+=09=09case=20AT_DropOf:=09=09=09/*=20= NOT=20OF=20*/=0A+=09=09=09ATSimplePermissions(cmd->subtype,=20rel,=0A+=09= =09=09=09=09=09=09=09ATT_TABLE=20|=20ATT_PARTITIONED_TABLE);=0A+=09=09=09= /*=20These=20commands=20never=20recurse=20*/=0A+=09=09=09/*=20No=20= command-specific=20prep=20needed=20*/=0A+=0A+=09=09=09/*=0A+=09=09=09=20= *=20They=20only=20work=20on=20partitioned=20tables=20but=20child=20= partitions,=20thus=0A+=09=09=09=20*=20no=20need=20to=20emit=20a=20notice=0A= +=09=09=09=20*/=0A+=09=09=09pass=20=3D=20AT_PASS_MISC;=0A=20=09=09=09= break;=0A=20=09=09case=20AT_GenericOptions:=0A=20=09=09=09= ATSimplePermissions(cmd->subtype,=20rel,=20ATT_FOREIGN_TABLE);=0A@@=20= -6762,6=20+6794,8=20@@=20alter_table_type_to_string(AlterTableType=20= cmdtype)=0A=20=09=09=09return=20"ALTER=20COLUMN=20...=20DROP=20= IDENTITY";=0A=20=09=09case=20AT_ReAddStatistics:=0A=20=09=09=09return=20= NULL;=09=09/*=20not=20real=20grammar=20*/=0A+=09=09case=20AT_SetSchema:=0A= +=09=09=09return=20"SET=20SCHEMA";=0A=20=09}=0A=20=0A=20=09return=20= NULL;=0A@@=20-6883,7=20+6917,7=20@@=20ATSimpleRecursion(List=20**wqueue,=20= Relation=20rel,=0A=20=09=09=09/*=20find_all_inheritors=20already=20got=20= lock=20*/=0A=20=09=09=09childrel=20=3D=20relation_open(childrelid,=20= NoLock);=0A=20=09=09=09CheckAlterTableIsSafe(childrel);=0A-=09=09=09= ATPrepCmd(wqueue,=20childrel,=20cmd,=20false,=20true,=20lockmode,=20= context);=0A+=09=09=09ATPrepCmd(wqueue,=20childrel,=20cmd,=20false,=20= true,=20lockmode,=20context,=20NULL);=0A=20=09=09=09= relation_close(childrel,=20NoLock);=0A=20=09=09}=0A=20=09}=0A@@=20= -6946,7=20+6980,7=20@@=20ATTypedTableRecursion(List=20**wqueue,=20= Relation=20rel,=20AlterTableCmd=20*cmd,=0A=20=0A=20=09=09childrel=20=3D=20= relation_open(childrelid,=20lockmode);=0A=20=09=09= CheckAlterTableIsSafe(childrel);=0A-=09=09ATPrepCmd(wqueue,=20childrel,=20= cmd,=20true,=20true,=20lockmode,=20context);=0A+=09=09ATPrepCmd(wqueue,=20= childrel,=20cmd,=20true,=20true,=20lockmode,=20context,=20NULL);=0A=20=09= =09relation_close(childrel,=20NoLock);=0A=20=09}=0A=20}=0A@@=20-9592,7=20= +9626,7=20@@=20ATPrepAddPrimaryKey(List=20**wqueue,=20Relation=20rel,=20= AlterTableCmd=20*cmd,=0A=20=09=09newcmd->recurse=20=3D=20true;=0A=20=09=09= newcmd->def=20=3D=20(Node=20*)=20nnconstr;=0A=20=0A-=09=09= ATPrepCmd(wqueue,=20rel,=20newcmd,=20true,=20false,=20lockmode,=20= context);=0A+=09=09ATPrepCmd(wqueue,=20rel,=20newcmd,=20true,=20false,=20= lockmode,=20context,=20NULL);=0A=20=09}=0A=20}=0A=20=0A@@=20-14673,7=20= +14707,7=20@@=20ATPrepAlterColumnType(List=20**wqueue,=0A=20=09=09=09=09=09= =09=09=20errdetail("USING=20expression=20contains=20a=20whole-row=20= table=20reference.")));=0A=20=09=09=09=09pfree(attmap);=0A=20=09=09=09}=0A= -=09=09=09ATPrepCmd(wqueue,=20childrel,=20cmd,=20false,=20true,=20= lockmode,=20context);=0A+=09=09=09ATPrepCmd(wqueue,=20childrel,=20cmd,=20= false,=20true,=20lockmode,=20context,=20NULL);=0A=20=09=09=09= relation_close(childrel,=20NoLock);=0A=20=09=09}=0A=20=09}=0A@@=20= -18977,6=20+19011,7=20@@=20AlterTableNamespace(AlterObjectSchemaStmt=20= *stmt,=20Oid=20*oldschema)=0A=20=09RangeVar=20=20=20*newrv;=0A=20=09= ObjectAddresses=20*objsMoved;=0A=20=09ObjectAddress=20myself;=0A+=09List=09= =20=20=20*pendingNotice=20=3D=20NIL;=0A=20=0A=20=09relid=20=3D=20= RangeVarGetRelidExtended(stmt->relation,=20AccessExclusiveLock,=0A=20=09=09= =09=09=09=09=09=09=09=20stmt->missing_ok=20?=20RVR_MISSING_OK=20:=200,=0A= @@=20-18993,6=20+19028,13=20@@=20= AlterTableNamespace(AlterObjectSchemaStmt=20*stmt,=20Oid=20*oldschema)=0A= =20=0A=20=09rel=20=3D=20relation_open(relid,=20NoLock);=0A=20=0A+=09/*=0A= +=09=20*=20SET=20SCHEMA=20doesn't=20recurse=20to=20children,=20emit=20a=20= notice=20if=20ONLY=20is=20not=0A+=09=20*=20specified.=20As=20this=20= action=20doesn't=20go=20through=20ATPrepCmd,=20we=20have=20to=20emit=0A+=09= =20*=20the=20notice=20here.=0A+=09=20*/=0A+=09= CollectPartitionNoRecurseNotice(AT_SetSchema,=20rel,=20= stmt->relation->inh,=20false,=20&pendingNotice);=0A+=0A=20=09oldNspOid=20= =3D=20RelationGetNamespace(rel);=0A=20=0A=20=09/*=20If=20it's=20an=20= owned=20sequence,=20disallow=20moving=20it=20by=20itself.=20*/=0A@@=20= -19030,6=20+19072,8=20@@=20AlterTableNamespace(AlterObjectSchemaStmt=20= *stmt,=20Oid=20*oldschema)=0A=20=09/*=20close=20rel,=20but=20keep=20lock=20= until=20commit=20*/=0A=20=09relation_close(rel,=20NoLock);=0A=20=0A+=09= EmitPartitionNoRecurseNotice(pendingNotice);=0A+=0A=20=09return=20= myself;=0A=20}=0A=20=0A@@=20-23381,3=20+23425,71=20@@=20= ATExecSplitPartition(List=20**wqueue,=20AlteredTableInfo=20*tab,=20= Relation=20rel,=0A=20=09/*=20Restore=20the=20userid=20and=20security=20= context.=20*/=0A=20=09SetUserIdAndSecContext(save_userid,=20= save_sec_context);=0A=20}=0A+=0A+/*=0A+=20*=20When=20ONLY=20is=20not=20= specified=20with=20a=20partitioned=20table,=20it=20is=20expected=20that=20= the=0A+=20*=20command=20recurses=20to=20all=20partitions.=20However,=20= some=20sub-commands=20do=20not=20recurse.=0A+=20*=20In=20such=20cases,=20= emit=20a=20NOTICE=20to=20make=20this=20behavior=20explicit=20to=20the=20= user.=0A+=20*/=0A+static=20void=0A= +CollectPartitionNoRecurseNotice(AlterTableType=20cmdtype,=20Relation=20= rel,=20bool=20recurse,=20bool=20recursing,=0A+=09=09=09=09=09=09=09=09= List=20**pendingNotice)=0A+{=0A+=09if=20(pendingNotice=20=3D=3D=20NULL)=0A= +=09=09return;=0A+=0A+=09/*=20Only=20emit=20the=20notice=20at=20the=20= top=20level=20of=20recursion=20*/=0A+=09if=20(rel->rd_rel->relkind=20=3D=3D= =20RELKIND_PARTITIONED_TABLE=20&&=20recurse=20&&=20!recursing)=0A+=09{=0A= +=09=09PartitionDesc=20pd=20=3D=20RelationGetPartitionDesc(rel,=20true);=0A= +=09=09int=09=09=09nparts=20=3D=20pd->nparts;=0A+=09=09const=20char=20= *action_str;=0A+=09=09char=09=20=20=20*notice_msg;=0A+=09=09const=20= ListCell=20*cell;=0A+=09=09bool=09=09found=20=3D=20false;=0A+=0A+=09=09= /*=20Emit=20a=20notice=20only=20if=20there=20are=20partitions=20*/=0A+=09= =09if=20(nparts=20=3D=3D=200)=0A+=09=09=09return;=0A+=0A+=09=09= action_str=20=3D=20alter_table_type_to_string(cmdtype);=0A+=09=09= notice_msg=20=3D=20psprintf(_("ALTER=20action=20%s=20on=20relation=20= \"%s\"=20does=20not=20affect=20present=20partitions"),=0A+=09=09=09=09=09= =09=09=20=20action_str,=0A+=09=09=09=09=09=09=09=20=20= RelationGetRelationName(rel));=0A+=0A+=09=09foreach(cell,=20= *pendingNotice)=0A+=09=09{=0A+=09=09=09if=20(strcmp((char=20*)=20= lfirst(cell),=20notice_msg)=20=3D=3D=200)=0A+=09=09=09{=0A+=09=09=09=09= pfree(notice_msg);=0A+=09=09=09=09found=20=3D=20true;=0A+=09=09=09=09= break;=0A+=09=09=09}=0A+=09=09}=0A+=09=09if=20(!found)=0A+=09=09=09= *pendingNotice=20=3D=20lappend(*pendingNotice,=20notice_msg);=0A+=09}=0A= +}=0A+=0A+static=20void=0A+EmitPartitionNoRecurseNotice(List=20= *pendingNotice)=0A+{=0A+=09ListCell=20=20=20*cell;=0A+=09int=09=09=09= len;=0A+=09int=09=09=09i=20=3D=200;=0A+=0A+=09len=20=3D=20= list_length(pendingNotice);=0A+=09foreach(cell,=20pendingNotice)=0A+=09{=0A= +=09=09char=09=20=20=20*notice_msg=20=3D=20(char=20*)=20lfirst(cell);=0A= +=0A+=09=09/*=20Only=20emit=20the=20hint=20for=20the=20last=20notice=20= */=0A+=09=09i++;=0A+=09=09ereport(NOTICE,=20errmsg("%s",=20notice_msg),=0A= +=09=09=09=09(i=20=3D=3D=20len)=20?=0A+=09=09=09=09errhint("Partitions=20= may=20be=20modified=20individually,=20or=20specify=20ONLY=20to=20= suppress=20this=20message.")=0A+=09=09=09=09:=200);=0A+=09=09= pfree(notice_msg);=0A+=09}=0A+=09list_free(pendingNotice);=0A+}=0Adiff=20= --git=20a/src/include/nodes/parsenodes.h=20= b/src/include/nodes/parsenodes.h=0Aindex=20f3d32ef0188..1267fb59d3f=20= 100644=0A---=20a/src/include/nodes/parsenodes.h=0A+++=20= b/src/include/nodes/parsenodes.h=0A@@=20-2511,6=20+2511,7=20@@=20typedef=20= enum=20AlterTableType=0A=20=09AT_SetIdentity,=09=09=09=09/*=20SET=20= identity=20column=20options=20*/=0A=20=09AT_DropIdentity,=09=09=09/*=20= DROP=20IDENTITY=20*/=0A=20=09AT_ReAddStatistics,=09=09=09/*=20internal=20= to=20commands/tablecmds.c=20*/=0A+=09AT_SetSchema,=09=09=09=09/*=20SET=20= SCHEMA=20*/=0A=20}=20AlterTableType;=0A=20=0A=20typedef=20struct=20= AlterTableCmd=09/*=20one=20subcommand=20of=20an=20ALTER=20TABLE=20*/=0A= diff=20--git=20a/src/test/regress/expected/alter_table.out=20= b/src/test/regress/expected/alter_table.out=0Aindex=20= 5998c670aa3..bbb34bee938=20100644=0A---=20= a/src/test/regress/expected/alter_table.out=0A+++=20= b/src/test/regress/expected/alter_table.out=0A@@=20-4582,8=20+4582,90=20= @@=20SELECT=20*=20FROM=20list_parted;=0A=20---=0A=20(0=20rows)=0A=20=0A= +CREATE=20TABLE=20list_parted4=20(a=20int,=20b=20text)=20PARTITION=20BY=20= LIST=20(a);=0A+CREATE=20TABLE=20list_parted4_1=20PARTITION=20OF=20= list_parted4=20FOR=20VALUES=20IN=20(1);=0A+--=20set=20column=20attribute=20= on=20partitioned=20table=20without=20ONLY=20should=20get=20a=20notice=0A= +ALTER=20TABLE=20list_parted4=20ALTER=20COLUMN=20b=20SET=20(n_distinct=20= =3D=200.2);=0A+NOTICE:=20=20ALTER=20action=20ALTER=20COLUMN=20...=20SET=20= on=20relation=20"list_parted4"=20does=20not=20affect=20present=20= partitions=0A+HINT:=20=20Partitions=20may=20be=20modified=20= individually,=20or=20specify=20ONLY=20to=20suppress=20this=20message.=0A= +ALTER=20TABLE=20list_parted4=20ALTER=20COLUMN=20b=20RESET=20= (n_distinct);=0A+NOTICE:=20=20ALTER=20action=20ALTER=20COLUMN=20...=20= RESET=20on=20relation=20"list_parted4"=20does=20not=20affect=20present=20= partitions=0A+HINT:=20=20Partitions=20may=20be=20modified=20= individually,=20or=20specify=20ONLY=20to=20suppress=20this=20message.=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20ALTER=20COLUMN=20b=20SET=20= (n_distinct=20=3D=200.2);=0A+ALTER=20TABLE=20ONLY=20list_parted4=20ALTER=20= COLUMN=20b=20RESET=20(n_distinct);=0A+--=20enable/disable=20rules=20on=20= partitioned=20tables=20without=20ONLY=20should=20get=20a=20notice=0A= +CREATE=20RULE=20list_parted4_rule=20AS=20ON=20INSERT=20TO=20= list_parted4=20DO=20INSTEAD=20NOTHING;=0A+ALTER=20TABLE=20list_parted4=20= DISABLE=20RULE=20list_parted4_rule;=0A+NOTICE:=20=20ALTER=20action=20= DISABLE=20RULE=20on=20relation=20"list_parted4"=20does=20not=20affect=20= present=20partitions=0A+HINT:=20=20Partitions=20may=20be=20modified=20= individually,=20or=20specify=20ONLY=20to=20suppress=20this=20message.=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20DISABLE=20RULE=20= list_parted4_rule;=0A+ALTER=20TABLE=20list_parted4=20ENABLE=20RULE=20= list_parted4_rule;=0A+NOTICE:=20=20ALTER=20action=20ENABLE=20RULE=20on=20= relation=20"list_parted4"=20does=20not=20affect=20present=20partitions=0A= +HINT:=20=20Partitions=20may=20be=20modified=20individually,=20or=20= specify=20ONLY=20to=20suppress=20this=20message.=0A+ALTER=20TABLE=20ONLY=20= list_parted4=20ENABLE=20RULE=20list_parted4_rule;=0A+DROP=20RULE=20= list_parted4_rule=20ON=20list_parted4;=0A+--=20enable/disable=20row=20= level=20security=20on=20partitioned=20tables=20without=20ONLY=20should=20= get=20a=20notice=0A+ALTER=20TABLE=20list_parted4=20ENABLE=20ROW=20LEVEL=20= SECURITY;=0A+NOTICE:=20=20ALTER=20action=20ENABLE=20ROW=20SECURITY=20on=20= relation=20"list_parted4"=20does=20not=20affect=20present=20partitions=0A= +HINT:=20=20Partitions=20may=20be=20modified=20individually,=20or=20= specify=20ONLY=20to=20suppress=20this=20message.=0A+ALTER=20TABLE=20ONLY=20= list_parted4=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20= list_parted4=20DISABLE=20ROW=20LEVEL=20SECURITY;=0A+NOTICE:=20=20ALTER=20= action=20DISABLE=20ROW=20SECURITY=20on=20relation=20"list_parted4"=20= does=20not=20affect=20present=20partitions=0A+HINT:=20=20Partitions=20= may=20be=20modified=20individually,=20or=20specify=20ONLY=20to=20= suppress=20this=20message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20= DISABLE=20ROW=20LEVEL=20SECURITY;=0A+--=20force/no=20force=20row=20level=20= security=20on=20partitioned=20tables=20without=20ONLY=20should=20get=20a=20= notice=0A+ALTER=20TABLE=20list_parted4=20FORCE=20ROW=20LEVEL=20SECURITY;=0A= +NOTICE:=20=20ALTER=20action=20FORCE=20ROW=20SECURITY=20on=20relation=20= "list_parted4"=20does=20not=20affect=20present=20partitions=0A+HINT:=20=20= Partitions=20may=20be=20modified=20individually,=20or=20specify=20ONLY=20= to=20suppress=20this=20message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20= FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20list_parted4=20NO=20= FORCE=20ROW=20LEVEL=20SECURITY;=0A+NOTICE:=20=20ALTER=20action=20NO=20= FORCE=20ROW=20SECURITY=20on=20relation=20"list_parted4"=20does=20not=20= affect=20present=20partitions=0A+HINT:=20=20Partitions=20may=20be=20= modified=20individually,=20or=20specify=20ONLY=20to=20suppress=20this=20= message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20NO=20FORCE=20ROW=20= LEVEL=20SECURITY;=0A+--=20set=20replica=20identity=20on=20partitioned=20= tables=20without=20ONLY=20should=20get=20a=20notice=0A+ALTER=20TABLE=20= list_parted4=20REPLICA=20IDENTITY=20FULL;=0A+NOTICE:=20=20ALTER=20action=20= REPLICA=20IDENTITY=20on=20relation=20"list_parted4"=20does=20not=20= affect=20present=20partitions=0A+HINT:=20=20Partitions=20may=20be=20= modified=20individually,=20or=20specify=20ONLY=20to=20suppress=20this=20= message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20REPLICA=20IDENTITY=20= FULL;=0A+ALTER=20TABLE=20list_parted4=20REPLICA=20IDENTITY=20NOTHING;=0A= +NOTICE:=20=20ALTER=20action=20REPLICA=20IDENTITY=20on=20relation=20= "list_parted4"=20does=20not=20affect=20present=20partitions=0A+HINT:=20=20= Partitions=20may=20be=20modified=20individually,=20or=20specify=20ONLY=20= to=20suppress=20this=20message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20= REPLICA=20IDENTITY=20NOTHING;=0A+--=20set=20compression=20on=20= partitioned=20tables=20without=20ONLY=20should=20get=20a=20notice=0A= +ALTER=20TABLE=20list_parted4=20ALTER=20COLUMN=20b=20SET=20COMPRESSION=20= pglz;=0A+NOTICE:=20=20ALTER=20action=20ALTER=20COLUMN=20...=20SET=20= COMPRESSION=20on=20relation=20"list_parted4"=20does=20not=20affect=20= present=20partitions=0A+HINT:=20=20Partitions=20may=20be=20modified=20= individually,=20or=20specify=20ONLY=20to=20suppress=20this=20message.=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20ALTER=20COLUMN=20b=20SET=20= COMPRESSION=20pglz;=0A+--=20set=20owner=20on=20partitioned=20tables=20= without=20ONLY=20should=20get=20a=20notice=0A+ALTER=20TABLE=20= list_parted4=20OWNER=20TO=20regress_alter_table_user1;=0A+NOTICE:=20=20= ALTER=20action=20OWNER=20TO=20on=20relation=20"list_parted4"=20does=20= not=20affect=20present=20partitions=0A+HINT:=20=20Partitions=20may=20be=20= modified=20individually,=20or=20specify=20ONLY=20to=20suppress=20this=20= message.=0A+ALTER=20TABLE=20ONLY=20list_parted4=20OWNER=20TO=20= regress_alter_table_user1;=0A+--=20set=20schema=20on=20partitioned=20= tables=20without=20ONLY=20should=20get=20a=20notice=0A+CREATE=20SCHEMA=20= alter_table_test_schema;=0A+ALTER=20TABLE=20list_parted4=20SET=20SCHEMA=20= alter_table_test_schema;=0A+NOTICE:=20=20ALTER=20action=20SET=20SCHEMA=20= on=20relation=20"list_parted4"=20does=20not=20affect=20present=20= partitions=0A+HINT:=20=20Partitions=20may=20be=20modified=20= individually,=20or=20specify=20ONLY=20to=20suppress=20this=20message.=0A= +ALTER=20TABLE=20ONLY=20alter_table_test_schema.list_parted4=20SET=20= SCHEMA=20public;=0A+DROP=20SCHEMA=20alter_table_test_schema=20CASCADE;=0A= +--=20when=20there=20are=20multiple=20sub-command,=20notice=20should=20= not=20duplicated=0A+ALTER=20TABLE=20list_parted4=0A+=20=20ALTER=20COLUMN=20= b=20SET=20COMPRESSION=20pglz,=0A+=20=20ALTER=20COLUMN=20b=20SET=20= COMPRESSION=20pglz,=20--=20duplicate,=20but=20should=20not=20get=20= duplicate=20notice=0A+=20=20FORCE=20ROW=20LEVEL=20SECURITY,=0A+=20=20= REPLICA=20IDENTITY=20FULL,=0A+=20=20OWNER=20TO=20= regress_alter_table_user1;=0A+NOTICE:=20=20ALTER=20action=20ALTER=20= COLUMN=20...=20SET=20COMPRESSION=20on=20relation=20"list_parted4"=20does=20= not=20affect=20present=20partitions=0A+NOTICE:=20=20ALTER=20action=20= FORCE=20ROW=20SECURITY=20on=20relation=20"list_parted4"=20does=20not=20= affect=20present=20partitions=0A+NOTICE:=20=20ALTER=20action=20REPLICA=20= IDENTITY=20on=20relation=20"list_parted4"=20does=20not=20affect=20= present=20partitions=0A+NOTICE:=20=20ALTER=20action=20OWNER=20TO=20on=20= relation=20"list_parted4"=20does=20not=20affect=20present=20partitions=0A= +HINT:=20=20Partitions=20may=20be=20modified=20individually,=20or=20= specify=20ONLY=20to=20suppress=20this=20message.=0A+--=20list_parted5=20= is=20a=20partitioned=20table=20that=20has=20no=20partition.=0A+CREATE=20= TABLE=20list_parted5=20(a=20int,=20b=20text)=20PARTITION=20BY=20LIST=20= (a);=0A+--=20as=20it=20has=20no=20partition,=20there=20should=20be=20no=20= notice=20when=20altering=20it=20without=20ONLY=0A+ALTER=20TABLE=20= list_parted5=20FORCE=20ROW=20LEVEL=20SECURITY;=0A=20--=20cleanup=0A-DROP=20= TABLE=20list_parted,=20list_parted2,=20range_parted,=20list_parted3;=0A= +DROP=20TABLE=20list_parted,=20list_parted2,=20range_parted,=20= list_parted3,=20list_parted4,=20list_parted5;=0A=20DROP=20TABLE=20= fail_def_part;=0A=20DROP=20TABLE=20hash_parted;=0A=20--=20more=20tests=20= for=20certain=20multi-level=20partitioning=20scenarios=0Adiff=20--git=20= a/src/test/regress/expected/cluster.out=20= b/src/test/regress/expected/cluster.out=0Aindex=20= 24b0b1a8fce..67d7ef6509d=20100644=0A---=20= a/src/test/regress/expected/cluster.out=0A+++=20= b/src/test/regress/expected/cluster.out=0A@@=20-547,7=20+547,7=20@@=20= SET=20SESSION=20AUTHORIZATION=20regress_ptnowner;=0A=20CLUSTER=20= ptnowner=20USING=20ptnowner_i_idx;=0A=20ERROR:=20=20permission=20denied=20= for=20table=20ptnowner=0A=20RESET=20SESSION=20AUTHORIZATION;=0A-ALTER=20= TABLE=20ptnowner=20OWNER=20TO=20regress_ptnowner;=0A+ALTER=20TABLE=20= ONLY=20ptnowner=20OWNER=20TO=20regress_ptnowner;=0A=20CREATE=20TEMP=20= TABLE=20ptnowner_oldnodes=20AS=0A=20=20=20SELECT=20oid,=20relname,=20= relfilenode=20FROM=20pg_partition_tree('ptnowner')=20AS=20tree=0A=20=20=20= JOIN=20pg_class=20AS=20c=20ON=20c.oid=3Dtree.relid;=0Adiff=20--git=20= a/src/test/regress/expected/merge.out=20= b/src/test/regress/expected/merge.out=0Aindex=209cb1d87066a..bd6aac72336=20= 100644=0A---=20a/src/test/regress/expected/merge.out=0A+++=20= b/src/test/regress/expected/merge.out=0A@@=20-2298,8=20+2298,8=20@@=20= SELECT=20*=20FROM=20pa_target=20ORDER=20BY=20tid,=20val;=0A=20ROLLBACK;=0A= =20--=20test=20RLS=20enforcement=0A=20BEGIN;=0A-ALTER=20TABLE=20= pa_target=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A-ALTER=20TABLE=20= pa_target=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= pa_target=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= pa_target=20FORCE=20ROW=20LEVEL=20SECURITY;=0A=20CREATE=20POLICY=20= pa_target_pol=20ON=20pa_target=20USING=20(tid=20!=3D=200);=0A=20MERGE=20= INTO=20pa_target=20t=0A=20=20=20USING=20pa_source=20s=0Adiff=20--git=20= a/src/test/regress/expected/partition_merge.out=20= b/src/test/regress/expected/partition_merge.out=0Aindex=20= 925fe4f570a..f629fc7f3e5=20100644=0A---=20= a/src/test/regress/expected/partition_merge.out=0A+++=20= b/src/test/regress/expected/partition_merge.out=0A@@=20-810,7=20+810,7=20= @@=20SET=20SESSION=20AUTHORIZATION=20regress_partition_merge_bob;=0A=20= ALTER=20TABLE=20t=20MERGE=20PARTITIONS=20(tp_0_1,=20tp_1_2)=20INTO=20= tp_0_2;=0A=20ERROR:=20=20must=20be=20owner=20of=20table=20t=0A=20RESET=20= SESSION=20AUTHORIZATION;=0A-ALTER=20TABLE=20t=20OWNER=20TO=20= regress_partition_merge_bob;=0A+ALTER=20TABLE=20ONLY=20t=20OWNER=20TO=20= regress_partition_merge_bob;=0A=20SET=20SESSION=20AUTHORIZATION=20= regress_partition_merge_bob;=0A=20--=20ERROR:=20=20must=20be=20owner=20= of=20table=20tp_0_1=0A=20ALTER=20TABLE=20t=20MERGE=20PARTITIONS=20= (tp_0_1,=20tp_1_2)=20INTO=20tp_0_2;=0Adiff=20--git=20= a/src/test/regress/expected/partition_split.out=20= b/src/test/regress/expected/partition_split.out=0Aindex=20= 4004efe0dac..421fa36ec0f=20100644=0A---=20= a/src/test/regress/expected/partition_split.out=0A+++=20= b/src/test/regress/expected/partition_split.out=0A@@=20-1372,7=20+1372,7=20= @@=20ALTER=20TABLE=20t=20SPLIT=20PARTITION=20tp_0_2=20INTO=0A=20=20=20=20= PARTITION=20tp_1_2=20FOR=20VALUES=20FROM=20(1)=20TO=20(2));=20--error=0A=20= ERROR:=20=20must=20be=20owner=20of=20table=20t=0A=20RESET=20SESSION=20= AUTHORIZATION;=0A-ALTER=20TABLE=20t=20OWNER=20TO=20= regress_partition_split_bob;=0A+ALTER=20TABLE=20ONLY=20t=20OWNER=20TO=20= regress_partition_split_bob;=0A=20SET=20SESSION=20AUTHORIZATION=20= regress_partition_split_bob;=0A=20ALTER=20TABLE=20t=20SPLIT=20PARTITION=20= tp_0_2=20INTO=0A=20=20=20(PARTITION=20tp_0_1=20FOR=20VALUES=20FROM=20(0)=20= TO=20(1),=0Adiff=20--git=20a/src/test/regress/expected/privileges.out=20= b/src/test/regress/expected/privileges.out=0Aindex=20= 7bc274566c3..877a1214963=20100644=0A---=20= a/src/test/regress/expected/privileges.out=0A+++=20= b/src/test/regress/expected/privileges.out=0A@@=20-1908,7=20+1908,7=20@@=20= SELECT=20brin_summarize_range('sro_brin',=200);=0A=20DROP=20TABLE=20= sro_tab;=0A=20--=20Check=20with=20a=20partitioned=20table=0A=20CREATE=20= TABLE=20sro_ptab=20(a=20int)=20PARTITION=20BY=20RANGE=20(a);=0A-ALTER=20= TABLE=20sro_ptab=20OWNER=20TO=20regress_sro_user;=0A+ALTER=20TABLE=20= ONLY=20sro_ptab=20OWNER=20TO=20regress_sro_user;=0A=20CREATE=20TABLE=20= sro_part=20PARTITION=20OF=20sro_ptab=20FOR=20VALUES=20FROM=20(1)=20TO=20= (10);=0A=20ALTER=20TABLE=20sro_part=20OWNER=20TO=20regress_sro_user;=0A=20= INSERT=20INTO=20sro_ptab=20VALUES=20(1),=20(2),=20(3);=0Adiff=20--git=20= a/src/test/regress/expected/rowsecurity.out=20= b/src/test/regress/expected/rowsecurity.out=0Aindex=20= 07d93e7def1..639c0065b0c=20100644=0A---=20= a/src/test/regress/expected/rowsecurity.out=0A+++=20= b/src/test/regress/expected/rowsecurity.out=0A@@=20-1233,7=20+1233,7=20= @@=20INSERT=20INTO=20part_document=20VALUES=0A=20=20=20=20=20(=208,=20= 55,=202,=20'regress_rls_carol',=20'great=20satire'),=0A=20=20=20=20=20(=20= 9,=2011,=201,=20'regress_rls_dave',=20'awesome=20science=20fiction'),=0A=20= =20=20=20=20(10,=2099,=202,=20'regress_rls_dave',=20'awesome=20= technology=20book');=0A-ALTER=20TABLE=20part_document=20ENABLE=20ROW=20= LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20part_document=20ENABLE=20ROW=20= LEVEL=20SECURITY;=0A=20--=20Create=20policy=20on=20parent=0A=20--=20= user's=20security=20level=20must=20be=20higher=20than=20or=20equal=20to=20= document's=0A=20CREATE=20POLICY=20pp1=20ON=20part_document=20AS=20= PERMISSIVE=0A@@=20-4914,7=20+4914,7=20@@=20CREATE=20TABLE=20rls_ptbl=20= (a=20int)=20PARTITION=20BY=20RANGE=20(a);=0A=20CREATE=20TABLE=20rls_part=20= PARTITION=20OF=20rls_ptbl=20FOR=20VALUES=20FROM=20(-100)=20TO=20(100);=0A= =20INSERT=20INTO=20rls_ptbl=20SELECT=20x/10=20FROM=20generate_series(1,=20= 100)=20x;=0A=20ANALYZE=20rls_ptbl,=20rls_part;=0A-ALTER=20TABLE=20= rls_ptbl=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= rls_ptbl=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A=20ALTER=20TABLE=20= rls_part=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A=20GRANT=20SELECT=20ON=20= rls_ptbl=20TO=20regress_rls_alice;=0A=20GRANT=20SELECT=20ON=20rls_part=20= TO=20regress_rls_alice;=0Adiff=20--git=20= a/src/test/regress/expected/tablespace.out=20= b/src/test/regress/expected/tablespace.out=0Aindex=20= 185880a3217..bf437a92746=20100644=0A---=20= a/src/test/regress/expected/tablespace.out=0A+++=20= b/src/test/regress/expected/tablespace.out=0A@@=20-290,13=20+290,13=20@@=20= CREATE=20TABLE=20testschema.part_2=20PARTITION=20OF=20testschema.part=20= FOR=20VALUES=20IN=20(2);=0A=20SET=20default_tablespace=20TO=20pg_global;=0A= =20CREATE=20TABLE=20testschema.part_3=20PARTITION=20OF=20testschema.part=20= FOR=20VALUES=20IN=20(3);=0A=20ERROR:=20=20only=20shared=20relations=20= can=20be=20placed=20in=20pg_global=20tablespace=0A-ALTER=20TABLE=20= testschema.part=20SET=20TABLESPACE=20regress_tblspace;=0A+ALTER=20TABLE=20= ONLY=20testschema.part=20SET=20TABLESPACE=20regress_tblspace;=0A=20= CREATE=20TABLE=20testschema.part_3=20PARTITION=20OF=20testschema.part=20= FOR=20VALUES=20IN=20(3);=0A=20CREATE=20TABLE=20testschema.part_4=20= PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20(4)=0A=20=20=20= TABLESPACE=20pg_default;=0A=20CREATE=20TABLE=20testschema.part_56=20= PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20(5,=206)=0A=20=20=20= PARTITION=20BY=20LIST=20(a);=0A-ALTER=20TABLE=20testschema.part=20SET=20= TABLESPACE=20pg_default;=0A+ALTER=20TABLE=20ONLY=20testschema.part=20SET=20= TABLESPACE=20pg_default;=0A=20CREATE=20TABLE=20testschema.part_78=20= PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20(7,=208)=0A=20=20=20= PARTITION=20BY=20LIST=20(a);=0A=20ERROR:=20=20only=20shared=20relations=20= can=20be=20placed=20in=20pg_global=20tablespace=0Adiff=20--git=20= a/src/test/regress/expected/update.out=20= b/src/test/regress/expected/update.out=0Aindex=20= eef2bac1cbf..584b40598eb=20100644=0A---=20= a/src/test/regress/expected/update.out=0A+++=20= b/src/test/regress/expected/update.out=0A@@=20-607,7=20+607,7=20@@=20= DROP=20TRIGGER=20trig_d15_20=20ON=20part_d_15_20;=0A=20DROP=20FUNCTION=20= func_parted_mod_b();=0A=20--=20RLS=20policies=20with=20= update-row-movement=0A=20-----------------------------------------=0A= -ALTER=20TABLE=20range_parted=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= +ALTER=20TABLE=20ONLY=20range_parted=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= =20CREATE=20USER=20regress_range_parted_user;=0A=20GRANT=20ALL=20ON=20= range_parted,=20mintab=20TO=20regress_range_parted_user;=0A=20CREATE=20= POLICY=20seeall=20ON=20range_parted=20AS=20PERMISSIVE=20FOR=20SELECT=20= USING=20(true);=0Adiff=20--git=20a/src/test/regress/expected/vacuum.out=20= b/src/test/regress/expected/vacuum.out=0Aindex=20= d4696bc3325..f22bb2127e1=20100644=0A---=20= a/src/test/regress/expected/vacuum.out=0A+++=20= b/src/test/regress/expected/vacuum.out=0A@@=20-614,7=20+614,7=20@@=20= VACUUM=20(ANALYZE)=20vacowned_part2;=0A=20WARNING:=20=20permission=20= denied=20to=20vacuum=20"vacowned_part2",=20skipping=20it=0A=20RESET=20= ROLE;=0A=20--=20Partitioned=20table=20and=20one=20partition=20owned=20by=20= other=20user.=0A-ALTER=20TABLE=20vacowned_parted=20OWNER=20TO=20= regress_vacuum;=0A+ALTER=20TABLE=20ONLY=20vacowned_parted=20OWNER=20TO=20= regress_vacuum;=0A=20ALTER=20TABLE=20vacowned_part1=20OWNER=20TO=20= regress_vacuum;=0A=20SET=20ROLE=20regress_vacuum;=0A=20VACUUM=20= vacowned_parted;=0A@@=20-634,7=20+634,7=20@@=20VACUUM=20(ANALYZE)=20= vacowned_part2;=0A=20WARNING:=20=20permission=20denied=20to=20vacuum=20= "vacowned_part2",=20skipping=20it=0A=20RESET=20ROLE;=0A=20--=20Only=20= one=20partition=20owned=20by=20other=20user.=0A-ALTER=20TABLE=20= vacowned_parted=20OWNER=20TO=20CURRENT_USER;=0A+ALTER=20TABLE=20ONLY=20= vacowned_parted=20OWNER=20TO=20CURRENT_USER;=0A=20SET=20ROLE=20= regress_vacuum;=0A=20VACUUM=20vacowned_parted;=0A=20WARNING:=20=20= permission=20denied=20to=20vacuum=20"vacowned_parted",=20skipping=20it=0A= @@=20-656,7=20+656,7=20@@=20VACUUM=20(ANALYZE)=20vacowned_part2;=0A=20= WARNING:=20=20permission=20denied=20to=20vacuum=20"vacowned_part2",=20= skipping=20it=0A=20RESET=20ROLE;=0A=20--=20Only=20partitioned=20table=20= owned=20by=20other=20user.=0A-ALTER=20TABLE=20vacowned_parted=20OWNER=20= TO=20regress_vacuum;=0A+ALTER=20TABLE=20ONLY=20vacowned_parted=20OWNER=20= TO=20regress_vacuum;=0A=20ALTER=20TABLE=20vacowned_part1=20OWNER=20TO=20= CURRENT_USER;=0A=20SET=20ROLE=20regress_vacuum;=0A=20VACUUM=20= vacowned_parted;=0Adiff=20--git=20a/src/test/regress/sql/alter_table.sql=20= b/src/test/regress/sql/alter_table.sql=0Aindex=20= d6b6381ae5c..97f641c78da=20100644=0A---=20= a/src/test/regress/sql/alter_table.sql=0A+++=20= b/src/test/regress/sql/alter_table.sql=0A@@=20-2908,8=20+2908,70=20@@=20= ALTER=20TABLE=20list_parted2=20ALTER=20COLUMN=20b=20TYPE=20text;=0A=20= ALTER=20TABLE=20list_parted=20DROP=20COLUMN=20b;=0A=20SELECT=20*=20FROM=20= list_parted;=0A=20=0A+CREATE=20TABLE=20list_parted4=20(a=20int,=20b=20= text)=20PARTITION=20BY=20LIST=20(a);=0A+CREATE=20TABLE=20list_parted4_1=20= PARTITION=20OF=20list_parted4=20FOR=20VALUES=20IN=20(1);=0A+=0A+--=20set=20= column=20attribute=20on=20partitioned=20table=20without=20ONLY=20should=20= get=20a=20notice=0A+ALTER=20TABLE=20list_parted4=20ALTER=20COLUMN=20b=20= SET=20(n_distinct=20=3D=200.2);=0A+ALTER=20TABLE=20list_parted4=20ALTER=20= COLUMN=20b=20RESET=20(n_distinct);=0A+ALTER=20TABLE=20ONLY=20= list_parted4=20ALTER=20COLUMN=20b=20SET=20(n_distinct=20=3D=200.2);=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20ALTER=20COLUMN=20b=20RESET=20= (n_distinct);=0A+=0A+--=20enable/disable=20rules=20on=20partitioned=20= tables=20without=20ONLY=20should=20get=20a=20notice=0A+CREATE=20RULE=20= list_parted4_rule=20AS=20ON=20INSERT=20TO=20list_parted4=20DO=20INSTEAD=20= NOTHING;=0A+ALTER=20TABLE=20list_parted4=20DISABLE=20RULE=20= list_parted4_rule;=0A+ALTER=20TABLE=20ONLY=20list_parted4=20DISABLE=20= RULE=20list_parted4_rule;=0A+ALTER=20TABLE=20list_parted4=20ENABLE=20= RULE=20list_parted4_rule;=0A+ALTER=20TABLE=20ONLY=20list_parted4=20= ENABLE=20RULE=20list_parted4_rule;=0A+DROP=20RULE=20list_parted4_rule=20= ON=20list_parted4;=0A+=0A+--=20enable/disable=20row=20level=20security=20= on=20partitioned=20tables=20without=20ONLY=20should=20get=20a=20notice=0A= +ALTER=20TABLE=20list_parted4=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= +ALTER=20TABLE=20list_parted4=20DISABLE=20ROW=20LEVEL=20SECURITY;=0A= +ALTER=20TABLE=20ONLY=20list_parted4=20DISABLE=20ROW=20LEVEL=20SECURITY;=0A= +=0A+--=20force/no=20force=20row=20level=20security=20on=20partitioned=20= tables=20without=20ONLY=20should=20get=20a=20notice=0A+ALTER=20TABLE=20= list_parted4=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= list_parted4=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20= list_parted4=20NO=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20= ONLY=20list_parted4=20NO=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+=0A+--=20= set=20replica=20identity=20on=20partitioned=20tables=20without=20ONLY=20= should=20get=20a=20notice=0A+ALTER=20TABLE=20list_parted4=20REPLICA=20= IDENTITY=20FULL;=0A+ALTER=20TABLE=20ONLY=20list_parted4=20REPLICA=20= IDENTITY=20FULL;=0A+ALTER=20TABLE=20list_parted4=20REPLICA=20IDENTITY=20= NOTHING;=0A+ALTER=20TABLE=20ONLY=20list_parted4=20REPLICA=20IDENTITY=20= NOTHING;=0A+=0A+--=20set=20compression=20on=20partitioned=20tables=20= without=20ONLY=20should=20get=20a=20notice=0A+ALTER=20TABLE=20= list_parted4=20ALTER=20COLUMN=20b=20SET=20COMPRESSION=20pglz;=0A+ALTER=20= TABLE=20ONLY=20list_parted4=20ALTER=20COLUMN=20b=20SET=20COMPRESSION=20= pglz;=0A+=0A+--=20set=20owner=20on=20partitioned=20tables=20without=20= ONLY=20should=20get=20a=20notice=0A+ALTER=20TABLE=20list_parted4=20OWNER=20= TO=20regress_alter_table_user1;=0A+ALTER=20TABLE=20ONLY=20list_parted4=20= OWNER=20TO=20regress_alter_table_user1;=0A+=0A+--=20set=20schema=20on=20= partitioned=20tables=20without=20ONLY=20should=20get=20a=20notice=0A= +CREATE=20SCHEMA=20alter_table_test_schema;=0A+ALTER=20TABLE=20= list_parted4=20SET=20SCHEMA=20alter_table_test_schema;=0A+ALTER=20TABLE=20= ONLY=20alter_table_test_schema.list_parted4=20SET=20SCHEMA=20public;=0A= +DROP=20SCHEMA=20alter_table_test_schema=20CASCADE;=0A+=0A+--=20when=20= there=20are=20multiple=20sub-command,=20notice=20should=20not=20= duplicated=0A+ALTER=20TABLE=20list_parted4=0A+=20=20ALTER=20COLUMN=20b=20= SET=20COMPRESSION=20pglz,=0A+=20=20ALTER=20COLUMN=20b=20SET=20= COMPRESSION=20pglz,=20--=20duplicate,=20but=20should=20not=20get=20= duplicate=20notice=0A+=20=20FORCE=20ROW=20LEVEL=20SECURITY,=0A+=20=20= REPLICA=20IDENTITY=20FULL,=0A+=20=20OWNER=20TO=20= regress_alter_table_user1;=0A+=0A+--=20list_parted5=20is=20a=20= partitioned=20table=20that=20has=20no=20partition.=0A+CREATE=20TABLE=20= list_parted5=20(a=20int,=20b=20text)=20PARTITION=20BY=20LIST=20(a);=0A= +--=20as=20it=20has=20no=20partition,=20there=20should=20be=20no=20= notice=20when=20altering=20it=20without=20ONLY=0A+ALTER=20TABLE=20= list_parted5=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+=0A=20--=20cleanup=0A= -DROP=20TABLE=20list_parted,=20list_parted2,=20range_parted,=20= list_parted3;=0A+DROP=20TABLE=20list_parted,=20list_parted2,=20= range_parted,=20list_parted3,=20list_parted4,=20list_parted5;=0A=20DROP=20= TABLE=20fail_def_part;=0A=20DROP=20TABLE=20hash_parted;=0A=20=0Adiff=20= --git=20a/src/test/regress/sql/cluster.sql=20= b/src/test/regress/sql/cluster.sql=0Aindex=20f90c6ec200b..3405e93ab0c=20= 100644=0A---=20a/src/test/regress/sql/cluster.sql=0A+++=20= b/src/test/regress/sql/cluster.sql=0A@@=20-260,7=20+260,7=20@@=20ALTER=20= TABLE=20ptnowner1=20OWNER=20TO=20regress_ptnowner;=0A=20SET=20SESSION=20= AUTHORIZATION=20regress_ptnowner;=0A=20CLUSTER=20ptnowner=20USING=20= ptnowner_i_idx;=0A=20RESET=20SESSION=20AUTHORIZATION;=0A-ALTER=20TABLE=20= ptnowner=20OWNER=20TO=20regress_ptnowner;=0A+ALTER=20TABLE=20ONLY=20= ptnowner=20OWNER=20TO=20regress_ptnowner;=0A=20CREATE=20TEMP=20TABLE=20= ptnowner_oldnodes=20AS=0A=20=20=20SELECT=20oid,=20relname,=20relfilenode=20= FROM=20pg_partition_tree('ptnowner')=20AS=20tree=0A=20=20=20JOIN=20= pg_class=20AS=20c=20ON=20c.oid=3Dtree.relid;=0Adiff=20--git=20= a/src/test/regress/sql/merge.sql=20b/src/test/regress/sql/merge.sql=0A= index=202660b19f238..2bffcf7aa98=20100644=0A---=20= a/src/test/regress/sql/merge.sql=0A+++=20= b/src/test/regress/sql/merge.sql=0A@@=20-1422,8=20+1422,8=20@@=20= ROLLBACK;=0A=20=0A=20--=20test=20RLS=20enforcement=0A=20BEGIN;=0A-ALTER=20= TABLE=20pa_target=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A-ALTER=20TABLE=20= pa_target=20FORCE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= pa_target=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= pa_target=20FORCE=20ROW=20LEVEL=20SECURITY;=0A=20CREATE=20POLICY=20= pa_target_pol=20ON=20pa_target=20USING=20(tid=20!=3D=200);=0A=20MERGE=20= INTO=20pa_target=20t=0A=20=20=20USING=20pa_source=20s=0Adiff=20--git=20= a/src/test/regress/sql/partition_merge.sql=20= b/src/test/regress/sql/partition_merge.sql=0Aindex=20= a211fee2ad1..73bffb530dd=20100644=0A---=20= a/src/test/regress/sql/partition_merge.sql=0A+++=20= b/src/test/regress/sql/partition_merge.sql=0A@@=20-571,7=20+571,7=20@@=20= SET=20SESSION=20AUTHORIZATION=20regress_partition_merge_bob;=0A=20ALTER=20= TABLE=20t=20MERGE=20PARTITIONS=20(tp_0_1,=20tp_1_2)=20INTO=20tp_0_2;=0A=20= RESET=20SESSION=20AUTHORIZATION;=0A=20=0A-ALTER=20TABLE=20t=20OWNER=20TO=20= regress_partition_merge_bob;=0A+ALTER=20TABLE=20ONLY=20t=20OWNER=20TO=20= regress_partition_merge_bob;=0A=20SET=20SESSION=20AUTHORIZATION=20= regress_partition_merge_bob;=0A=20--=20ERROR:=20=20must=20be=20owner=20= of=20table=20tp_0_1=0A=20ALTER=20TABLE=20t=20MERGE=20PARTITIONS=20= (tp_0_1,=20tp_1_2)=20INTO=20tp_0_2;=0Adiff=20--git=20= a/src/test/regress/sql/partition_split.sql=20= b/src/test/regress/sql/partition_split.sql=0Aindex=20= 37c6d730840..f4f9c7886e4=20100644=0A---=20= a/src/test/regress/sql/partition_split.sql=0A+++=20= b/src/test/regress/sql/partition_split.sql=0A@@=20-960,7=20+960,7=20@@=20= ALTER=20TABLE=20t=20SPLIT=20PARTITION=20tp_0_2=20INTO=0A=20=20=20=20= PARTITION=20tp_1_2=20FOR=20VALUES=20FROM=20(1)=20TO=20(2));=20--error=0A=20= RESET=20SESSION=20AUTHORIZATION;=0A=20=0A-ALTER=20TABLE=20t=20OWNER=20TO=20= regress_partition_split_bob;=0A+ALTER=20TABLE=20ONLY=20t=20OWNER=20TO=20= regress_partition_split_bob;=0A=20SET=20SESSION=20AUTHORIZATION=20= regress_partition_split_bob;=0A=20ALTER=20TABLE=20t=20SPLIT=20PARTITION=20= tp_0_2=20INTO=0A=20=20=20(PARTITION=20tp_0_1=20FOR=20VALUES=20FROM=20(0)=20= TO=20(1),=0Adiff=20--git=20a/src/test/regress/sql/privileges.sql=20= b/src/test/regress/sql/privileges.sql=0Aindex=20540f73ea9b1..eb73629a81f=20= 100644=0A---=20a/src/test/regress/sql/privileges.sql=0A+++=20= b/src/test/regress/sql/privileges.sql=0A@@=20-1230,7=20+1230,7=20@@=20= SELECT=20brin_summarize_range('sro_brin',=200);=0A=20DROP=20TABLE=20= sro_tab;=0A=20--=20Check=20with=20a=20partitioned=20table=0A=20CREATE=20= TABLE=20sro_ptab=20(a=20int)=20PARTITION=20BY=20RANGE=20(a);=0A-ALTER=20= TABLE=20sro_ptab=20OWNER=20TO=20regress_sro_user;=0A+ALTER=20TABLE=20= ONLY=20sro_ptab=20OWNER=20TO=20regress_sro_user;=0A=20CREATE=20TABLE=20= sro_part=20PARTITION=20OF=20sro_ptab=20FOR=20VALUES=20FROM=20(1)=20TO=20= (10);=0A=20ALTER=20TABLE=20sro_part=20OWNER=20TO=20regress_sro_user;=0A=20= INSERT=20INTO=20sro_ptab=20VALUES=20(1),=20(2),=20(3);=0Adiff=20--git=20= a/src/test/regress/sql/rowsecurity.sql=20= b/src/test/regress/sql/rowsecurity.sql=0Aindex=20= 6b3566271df..1a2e80dade0=20100644=0A---=20= a/src/test/regress/sql/rowsecurity.sql=0A+++=20= b/src/test/regress/sql/rowsecurity.sql=0A@@=20-499,7=20+499,7=20@@=20= INSERT=20INTO=20part_document=20VALUES=0A=20=20=20=20=20(=209,=2011,=20= 1,=20'regress_rls_dave',=20'awesome=20science=20fiction'),=0A=20=20=20=20= =20(10,=2099,=202,=20'regress_rls_dave',=20'awesome=20technology=20= book');=0A=20=0A-ALTER=20TABLE=20part_document=20ENABLE=20ROW=20LEVEL=20= SECURITY;=0A+ALTER=20TABLE=20ONLY=20part_document=20ENABLE=20ROW=20LEVEL=20= SECURITY;=0A=20=0A=20--=20Create=20policy=20on=20parent=0A=20--=20user's=20= security=20level=20must=20be=20higher=20than=20or=20equal=20to=20= document's=0A@@=20-2414,7=20+2414,7=20@@=20CREATE=20TABLE=20rls_part=20= PARTITION=20OF=20rls_ptbl=20FOR=20VALUES=20FROM=20(-100)=20TO=20(100);=0A= =20INSERT=20INTO=20rls_ptbl=20SELECT=20x/10=20FROM=20generate_series(1,=20= 100)=20x;=0A=20ANALYZE=20rls_ptbl,=20rls_part;=0A=20=0A-ALTER=20TABLE=20= rls_ptbl=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A+ALTER=20TABLE=20ONLY=20= rls_ptbl=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A=20ALTER=20TABLE=20= rls_part=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A=20GRANT=20SELECT=20ON=20= rls_ptbl=20TO=20regress_rls_alice;=0A=20GRANT=20SELECT=20ON=20rls_part=20= TO=20regress_rls_alice;=0Adiff=20--git=20= a/src/test/regress/sql/tablespace.sql=20= b/src/test/regress/sql/tablespace.sql=0Aindex=20c43a59e5957..8eff2914a5b=20= 100644=0A---=20a/src/test/regress/sql/tablespace.sql=0A+++=20= b/src/test/regress/sql/tablespace.sql=0A@@=20-195,13=20+195,13=20@@=20= SET=20default_tablespace=20TO=20regress_tblspace;=0A=20CREATE=20TABLE=20= testschema.part_2=20PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20= (2);=0A=20SET=20default_tablespace=20TO=20pg_global;=0A=20CREATE=20TABLE=20= testschema.part_3=20PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20= (3);=0A-ALTER=20TABLE=20testschema.part=20SET=20TABLESPACE=20= regress_tblspace;=0A+ALTER=20TABLE=20ONLY=20testschema.part=20SET=20= TABLESPACE=20regress_tblspace;=0A=20CREATE=20TABLE=20testschema.part_3=20= PARTITION=20OF=20testschema.part=20FOR=20VALUES=20IN=20(3);=0A=20CREATE=20= TABLE=20testschema.part_4=20PARTITION=20OF=20testschema.part=20FOR=20= VALUES=20IN=20(4)=0A=20=20=20TABLESPACE=20pg_default;=0A=20CREATE=20= TABLE=20testschema.part_56=20PARTITION=20OF=20testschema.part=20FOR=20= VALUES=20IN=20(5,=206)=0A=20=20=20PARTITION=20BY=20LIST=20(a);=0A-ALTER=20= TABLE=20testschema.part=20SET=20TABLESPACE=20pg_default;=0A+ALTER=20= TABLE=20ONLY=20testschema.part=20SET=20TABLESPACE=20pg_default;=0A=20= CREATE=20TABLE=20testschema.part_78=20PARTITION=20OF=20testschema.part=20= FOR=20VALUES=20IN=20(7,=208)=0A=20=20=20PARTITION=20BY=20LIST=20(a);=0A=20= CREATE=20TABLE=20testschema.part_910=20PARTITION=20OF=20testschema.part=20= FOR=20VALUES=20IN=20(9,=2010)=0Adiff=20--git=20= a/src/test/regress/sql/update.sql=20b/src/test/regress/sql/update.sql=0A= index=208b4707eb9c3..56b1edb00ce=20100644=0A---=20= a/src/test/regress/sql/update.sql=0A+++=20= b/src/test/regress/sql/update.sql=0A@@=20-341,7=20+341,7=20@@=20DROP=20= FUNCTION=20func_parted_mod_b();=0A=20--=20RLS=20policies=20with=20= update-row-movement=0A=20-----------------------------------------=0A=20=0A= -ALTER=20TABLE=20range_parted=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= +ALTER=20TABLE=20ONLY=20range_parted=20ENABLE=20ROW=20LEVEL=20SECURITY;=0A= =20CREATE=20USER=20regress_range_parted_user;=0A=20GRANT=20ALL=20ON=20= range_parted,=20mintab=20TO=20regress_range_parted_user;=0A=20CREATE=20= POLICY=20seeall=20ON=20range_parted=20AS=20PERMISSIVE=20FOR=20SELECT=20= USING=20(true);=0Adiff=20--git=20a/src/test/regress/sql/vacuum.sql=20= b/src/test/regress/sql/vacuum.sql=0Aindex=20247b8e23b23..acff5824ebb=20= 100644=0A---=20a/src/test/regress/sql/vacuum.sql=0A+++=20= b/src/test/regress/sql/vacuum.sql=0A@@=20-452,7=20+452,7=20@@=20VACUUM=20= (ANALYZE)=20vacowned_part1;=0A=20VACUUM=20(ANALYZE)=20vacowned_part2;=0A=20= RESET=20ROLE;=0A=20--=20Partitioned=20table=20and=20one=20partition=20= owned=20by=20other=20user.=0A-ALTER=20TABLE=20vacowned_parted=20OWNER=20= TO=20regress_vacuum;=0A+ALTER=20TABLE=20ONLY=20vacowned_parted=20OWNER=20= TO=20regress_vacuum;=0A=20ALTER=20TABLE=20vacowned_part1=20OWNER=20TO=20= regress_vacuum;=0A=20SET=20ROLE=20regress_vacuum;=0A=20VACUUM=20= vacowned_parted;=0A@@=20-466,7=20+466,7=20@@=20VACUUM=20(ANALYZE)=20= vacowned_part1;=0A=20VACUUM=20(ANALYZE)=20vacowned_part2;=0A=20RESET=20= ROLE;=0A=20--=20Only=20one=20partition=20owned=20by=20other=20user.=0A= -ALTER=20TABLE=20vacowned_parted=20OWNER=20TO=20CURRENT_USER;=0A+ALTER=20= TABLE=20ONLY=20vacowned_parted=20OWNER=20TO=20CURRENT_USER;=0A=20SET=20= ROLE=20regress_vacuum;=0A=20VACUUM=20vacowned_parted;=0A=20VACUUM=20= vacowned_part1;=0A@@=20-479,7=20+479,7=20@@=20VACUUM=20(ANALYZE)=20= vacowned_part1;=0A=20VACUUM=20(ANALYZE)=20vacowned_part2;=0A=20RESET=20= ROLE;=0A=20--=20Only=20partitioned=20table=20owned=20by=20other=20user.=0A= -ALTER=20TABLE=20vacowned_parted=20OWNER=20TO=20regress_vacuum;=0A+ALTER=20= TABLE=20ONLY=20vacowned_parted=20OWNER=20TO=20regress_vacuum;=0A=20ALTER=20= TABLE=20vacowned_part1=20OWNER=20TO=20CURRENT_USER;=0A=20SET=20ROLE=20= regress_vacuum;=0A=20VACUUM=20vacowned_parted;=0A--=20=0A2.50.1=20(Apple=20= Git-155)=0A=0A= --Apple-Mail=_73264C59-D5EA-4B6F-B6AA-F4B2C81131D6--