Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNDYT-0001We-6h for pgsql-general@arkaria.postgresql.org; Thu, 24 Feb 2022 12:49:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNDYR-0007bm-0g for pgsql-general@arkaria.postgresql.org; Thu, 24 Feb 2022 12:49:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNDYQ-0007bc-Ll for pgsql-general@lists.postgresql.org; Thu, 24 Feb 2022 12:49:06 +0000 Received: from sonic310-13.consmr.mail.bf2.yahoo.com ([74.6.135.123]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nNDYM-0000IR-W0 for pgsql-general@lists.postgresql.org; Thu, 24 Feb 2022 12:49:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645706940; bh=CmmiqJnG8UjAYvjT+UvGgPTb/SFMp+h9WvYcrUOpcig=; h=Date:From:Reply-To:To:Subject:References:From:Subject:Reply-To; b=MZI9CIHvKcwwgTGhvzqE9F4aY86Msad+/cqvi19Hx3pp7bQ4jdPFv1zD/DU0qhPUVDAzy/kmESczxHD3H45XvGtStKlkCIQjymPTmsg+W5FjLnoqWo5Qc3j4OFt+wr1yrEJoPVDisGhPugClx66Ud9KV5sBkA4WZ6sGnnkhZuJ40sQjiomnmvTh69cZVS8Vt+yBCS2JF8L/+lZHCiNTmMp4WaJrXlVJIyg3G3Tmx+JsM+66A3Z26w0VGqIRx3ZoCwj7EGJ0UPBOU0vZvLcsjxE7akuqe27ns3ee4n15/Cewy8AmaHSTrODugRxqCNwJWFPHEj6wl3l9p51TG5LVC2g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645706940; bh=yysNwVUq5UaMr6hW8SAQvmxJeFgMUVnyLk1vRaQyXsX=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=JWSxLRauZRr5Zk1HHiIcDurQSIcjfJJu8cmnfNVGyRq3d8rPpclX3hng3Yc7JPtEXTROyN0/p/PHGyXOIYdvJ6oJyforsPniYHeny0Rxaa6ty/d4K+Lao+RqIgWg8yALyoAugRCFOnwluoesUJjEirmDcvk0vbKrz8zFZepuNa8AADgVdOkNhjc2arom6pVrfX3zndmlIZrvX8pIl6coste3c2ztynxIOW9KwXpPM0/Nc3srIAk5XCfL3hOQT+MwmzJzb4kqtBcSY6uLP6xHAf7wPrV12ULpb7dP8un73tykLKrDVLMNSkZn6hyyuhFAGy4Cq7GPUHmDsQwzVJ7WVQ== X-YMail-OSG: JltfjnQVM1mEgA2T5lYPQrOHgjY55Ws4NdYCauwPa2saWL32NhnfW4ojAaV8uYZ NlFH_zaTg6Y0bfxPFekZrDbKzdbojenkRQmSKllwOht.PNhe9so0nGKJvqClcG1vGuSGN03cDDBE dDGzN8Xjzohxi5cXE.CPd5OJtS2DlDVJIzzdEZNnKFOeqVrlYWbM1lR_fl9KdK2vcjRjGavTAQyb Iuu2K4WTMXa8ts1fOlKvRwZ2.Sg6CcqlCijMs9nXXI3FlssvxiXFgASoMbS1F_aYL4YHLUYZmYAI fPoX2zJwKpiCZSuTzYMvbZG7M9uv00QDX5CieZV6gHL6mQucpYmKiaih9WsQKR_xxvtIJEb_dgFK SV.xIKMBXcV8JCyqjjLxtAFBPRuy46q8LS48mk5tTXy_46kDY9TH_uPjFxQQR1_ZBHv9lmHTZKOM teEYZgSZm2xN1wpd63wgCE8JYU2v9KO1r9YwFpg4OoPzhkjtog4JI6bZumzuazIM.zRcUd1j7J7f GyPvrGMLah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0zeMuH0OEz03T5_xdK5S3IZCb6aOAp6OkWIe29QufNwktojEvMxxI68n.63mvOEc9qJ wPe6d7Hprx8ZxT40hGKoULbd8VZCz_7M4L0ap9OgebYK.RXTQojl4d1jeBBMZ4I_cp0nv3nneuVo gXU39dpQEl97HvUHECIlZCmN5Wxsa_XqwqR12PS_IpeEN9VQjakzZLuwncyfiPEpOfpk.wWG3zU8 DLmXYzzh1YZDRV.E5rwbZfn7wHcqlWGK2smA6_B3dBqLcvopVSbz8Xf05PLepGfQ1IMFN_HeDlNr dQOyHOo7Mtz8GSN2X224PRWAOBQUVwXuQHSST1WnJNeF6TEFFv5vABrzIf02mjnOgb58pbev3dF0 OtXock_Wj3GyZ7vEfeyNXGjhY3xY2QOv5AeOodufXnE1e4oJNsykuN49Nogmu6p9iGF1y215emMQ P19KOpOr5jqG7UvASXVmSOlzL.QU1I4rmH7X4OuwoSOEDctrAtl6wsoKD4w3W0ctd6scpwcKUhG7 mvVvlpr8j2zJ6_p_nzDlSYdbvBb9IDrU7pKB32XjkO0GSB6dupEk8wbRgx_SrG9WUJAkTpgDGo6a dUhL.awTq.2KcpHP92.lVq6IBO4lfAwyvPVOK17eYKit5QzuP4v74m0O13ep5g4uL_APmuU0ZrPX CI5rz1Zb8cN5wxSEyHKO8U27byDxBXDAfXcmXwzp.nrIvMjgAjKqfFIq2Mh3NupH_jfg3_Wbdxw- - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.bf2.yahoo.com with HTTP; Thu, 24 Feb 2022 12:49:00 +0000 Date: Thu, 24 Feb 2022 12:48:55 +0000 (UTC) From: Catalin Maftei Reply-To: Catalin Maftei To: "pgsql-general@lists.postgresql.org" Message-ID: <618793701.1030887.1645706935094@mail.yahoo.com> Subject: alter table to multi partitions MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1030886_2055298719.1645706935092" References: <618793701.1030887.1645706935094.ref@mail.yahoo.com> X-Mailer: WebService/1.1.19797 YMailNorrin Content-Length: 6896 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1030886_2055298719.1645706935092 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable hello, on a project I have large tables, with more than 2-5.000.000 rows, and the = system is starting to be slow,This tables have many dependencies functions,= procedures and views. I want to partition this tables.=C2=A0 I think for this scenario for table Orders: step1: =C2=A0=C2=A0=C2=A0=C2=A0create new table with same structure ->=C2= =A0 Orders_Partstep 2:=C2=A0 =C2=A0 create all the partitions&triggers on n= ew table=C2=A0Orders_Part step 3:=C2=A0 =C2=A0 copy/moved data from Orders=C2=A0to=C2=A0Orders_Part step 4:=C2=A0 =C2=A0 rename Orders to Orders_OldIf i want to drop Orders, i= t's=C2=A0necessary to drop all dependencies=C2=A0(and that's not what I wan= t) step 5:=C2=A0=C2=A0=C2=A0=C2=A0rename Orders_Part=C2=A0to Ordershere is the= problem - when rename Orders=C2=A0to Orders_old, postgres automatically ch= ange=C2=A0Orders=C2=A0to=C2=A0Orders_old=C2=A0in all dependencies (views, f= unctions, sp)=C2=A0 is there any postgres setting I can use to not=C2=A0 automatically change t= he in all the depandencies? --=20 -----------------=20 Best regards, Catalin Maftei ------=_Part_1030886_2055298719.1645706935092 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
hello,

on a project I have large t= ables, with more than 2-5.000.000 rows, and the system is starting to be sl= ow,
This tables have many dependencies fu= nctions, procedures and views.

I want to partition this tables. <= br style=3D"color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-ser= if; font-size: small;">
I think for this s= cenario for table Orders:
step1:     create new table with = same structure ->  Orders_Part
step 2:    create all the partitions&triggers on new table Orders_Part
step 3:    copy/moved data from Orders<= /b> to Orders_Part=
step 4:    <= /b>rename Orders to Orders_Old
If i want to drop Orders, it's necessary to drop all dependencies (and that's not what I want)
step 5:    rename Orders_Part to Orders
<= b>here is the problem - when rename Orders to Orders_old, postgres automatically change <= b>Orders to Orders_old&nb= sp;in all dependencies (views, functions, sp) 

is there any postgres setting I can use to not  automatically ch= ange the in all the depandencies?


--=20
-----------------=20
Best regards,
Catalin Maftei

------=_Part_1030886_2055298719.1645706935092--