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.94.2) (envelope-from ) id 1r81Jq-007r5u-Rp for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2023 16:52:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r81Jp-006Vbc-Gp for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2023 16:52:17 +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.94.2) (envelope-from ) id 1r81Jo-006VZO-9j for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2023 16:52:17 +0000 Received: from sonic317-26.consmr.mail.bf2.yahoo.com ([74.6.129.81]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r81Jl-007nfi-HH for pgsql-general@postgresql.org; Tue, 28 Nov 2023 16:52:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701190331; bh=tOggArajwv119NwgTgP6bm5Noe/twqaTozqfy57XAn0=; h=Date:From:Reply-To:To:Subject:References:From:Subject:Reply-To; b=tnsCxVIK5VsAWLtwSxUD+f3dOwLbPoCKL9aYaDs/hNIMGVHYf7b7wRbH8z5zH+TNsTVceegkKwWzz8NMVFJ2KAR/rKax2uFM3l1EGwrqcK4MYKA9XSAb9+8QVO9bXJi3K1Up6CjsILgq4JPCpirjL/2rRknkVkSsl8DKiRUyW+6Q5FIYTG+beNGx1nBzAVDfrjpVdVOr6yzyhryxZjxnGQll/v1ezlIcJ0dpUeNEggBzrHo/PLAy3ih7rUYGCWT3LR8+nJrxFYaeM5qTQ9WKWq8BuXcHEvvi75RlzK73NPnEnm5QXtSqxYTnft0QP1zwXl82WqXaPnkFtt0Gnq+MAQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701190331; bh=KH+DLUh1kF816LOSB/YJtveERKGhdPxDT8Tnm6d+L5Q=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=BzbOTmRRySsmfpb6+4JLw6bn2MXiMdD5q1zME2a3JA+9yjs0XNPHkhv+uCwb3EuH6koX0jFk1VBUMTfU8hI3lUarEM9+ZHgr+FCQc1N4dGwFP3Sah/9Zi9dG4nk+hVq5P9NLdGWJlrxwSm12FrTnaz+6MTzxv7gR7i3Pncd/QEilAhZpoXba53+aHlHWS9guUudY7M1JcfgHC1eZLL9WKpAqE58FMWei8rKGcPm0aU7m8VgnHRQWXqmXwqmGPbuR1S3Yvbauq3JWAAzp7CgwFgJ1k+tlnHuhSXaTK0/Q5fHPWnoW1vF5cfFGtgTRuDJIoguFUpDO5vTUIqDCUFbInw== X-YMail-OSG: POCIAesVM1lVASnSyB7RO6YEJNiIU0qp_hzSNpHroDO13364o5JKwIjeZRDH1Av K3GzuaBEcTlfy87uM0PrrOR48bbQDjZr.GIIfLRXXlA_XojHMOZRkG4yXpDHqzN1ggxACF7zDFgj iNbM_673jEQ3wctCyUwyZaQz2oIka9SjGctXJ4xRwEe6CoX6fxYC9wplM8rmVmjhXAimIrax.R5v j1xG9DD.FDgPkSxUUy1ZahpR4DToZrRJI8bY6IAMc7YpNCPIbX7z9F0JE_fAJAwiygJV9lbbrfK8 TKbuaATkHauEDeRdP4KWLYEemT4VkLK6LuHNduLnEkfdxuqOfuOn1rgGIfUcteHP6UryCBaDC6XU tYtzJKVAFIJXXnud1Xyu8EDBlUD0q_GeFVRNKgc71aM_4yOP2U3IdXUDIbak0dkTNCGFHYwXYH2R NaXH35jEuGolnMXBsgz7ft1.QTomzon6CUU9bzZHQTLFKlOP2WsumR24NPTUrj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fEqpL9SFK9O_U jQgiFRdxDTP8I39mU1BBhooZnQ.7BoVWXq_rlVVgbNhMEVswblsno7oBU7zP.jitpRecJLqDR_zJ W8gU5rxB2Y9lj77f3sOSaQsFGyC52ep4_UTQDR2SDKlfDhrbCsIyVuM77lx9tbwmkhlc4nU8VFOI nomCoPfBAG0_U3e29l1hcNt2toH56b_QFeFyFgzDTG3uFCkvXDK6cs0QRmQxgTToRvFseY8d.Mwm o2Drn8DTd46wiCNoOsF9QbIotGC4kFkvfH7lG0FW3bgKJrpNEuQil6yv2fZyCfjhy0TZt7O4Lc_t EY8GhirARo7PcI2HKAIaC2hc4b_4Dh9CY1BMMD4mO9aeYPOa6jibtUBxzWvjdTx0jtuvt887PBo0 dm8mc2vxzOniEHhwi84CKfsiiI21v_2sO8B658jFRExe0vJFBBnwbNFFX6VV8c88Zkc._2Lu2kaR IJ1Vd7GZoG0HhnCLaZrcu_d6v9P0z0DcocZw4axn_2dEhLY1J0K6iEJ8YiJRo5lhIt_ALfm0yU32 x9PrTc_l5Dup0wdxi.lWgUss4INYtrx9Ic7EdHhcxOdNWbIJhf1izYG49Gmdn_NwrEyB.xv9i00B przBQMtEJqWp2SD1aqAkP32WwGyP9Dbki_2Cx3HJMB_7iQMq5iX7g1pD_rbuK2i5fgr0vAVy0TGl FM0qu3VFY4ihjQKKapV8RvE.lWmY- X-Sonic-MF: X-Sonic-ID: dfd2887b-a4d7-4414-8551-08756b0fb58e Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Tue, 28 Nov 2023 16:52:11 +0000 Date: Tue, 28 Nov 2023 16:46:38 +0000 (UTC) From: CG Reply-To: CG To: "pgsql-general@postgresql.org" Message-ID: <1911886362.4840075.1701189998980@mail.yahoo.com> Subject: Off-label use for pg_repack MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4840074_201613290.1701189998979" References: <1911886362.4840075.1701189998980.ref@mail.yahoo.com> X-Mailer: WebService/1.1.21896 YMailNorrin Content-Length: 11077 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_4840074_201613290.1701189998979 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi fellow list members. I hit a brick wall with my last question. I'd like = to try this again.=C2=A0 I need to remove OIDs from tables without locking the tables for long perio= ds of time. I have developed a strategy that seems to work, but I would lik= e the experts to weigh in since I'm planning on doing things to the system = tables that are generally frowned upon. Prior to running pg_repack I perform these modifications: mydata=3D# update pg_class set relhasoids =3D false where oid =3D 'a_very_l= arge_table_with_oids'::regclass::oid;UPDATE 1mydata=3D#=C2=A0delete from pg= _attribute where attrelid =3D 'a_very_large_table_with_oids'::regclass::oid= and attname =3D 'oid';DELETE 1mydata=3D# \d+ a_very_large_table_with_oids;= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Table "public.a_very_large_table_with_oi= ds"=C2=A0Column | Type | Modifiers | Storage=C2=A0 | Stats target | Descrip= tion=C2=A0--------+------+-----------+----------+--------------+-----------= --=C2=A0k=C2=A0 =C2=A0 =C2=A0 | text | not null=C2=A0 | extended |=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0=C2=A0v=C2=A0 =C2=A0 =C2= =A0 | text |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| extended |=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0Indexes:=C2=A0 =C2=A0 "a_very= _large_table_with_oids_pkey" PRIMARY KEY, btree (k) mydata=3D# select oid,* from a_very_large_table_with_oids;ERROR:=C2=A0 colu= mn "oid" does not exist So far so good. I can insert update and delete rows, but the table structur= e on disk is unchanged.=C2=A0 So after those modifications I repack the table with vanilla pg_repack. Tha= t copies the data to a fresh new table, sans oids. Before I start performing these operations on-line on the production data I= wanted some expert eyes on this process since this is mission critical stu= ff. On the very large tables we will be in this limbo state for an extended= period of time where pg_class and pg_attribute will have those forced modi= fications while pg_repack works its magic. Is there anything to be concerne= d about if insert/update/delete seems to be working? My insert/update/delet= es on the tables while pg_repack is running seem to work fine. I also tried= this on tables that have toast tables attached and upon first glance, ever= ything seems to be in order. What have I missed? ------=_Part_4840074_201613290.1701189998979 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi fellow list members. I hit a brick wall w= ith my last question. I'd like to try this again. 

I= need to remove OIDs from tables without locking the tables for long period= s of time. I have developed a strategy that seems to work, but I would like= the experts to weigh in since I'm planning on doing things to the system t= ables that are generally frowned upon.

Prior to running pg_repack I perform these modifica= tions:

mydata=3D# update pg_class set relhasoids =3D false where oid = =3D 'a_very_large_table_with_oids'::regclass:= :oid;
UPDATE 1
mydata= =3D# delete from pg_attribute where attrelid =3D 'a_very_large_table_with_oids'::re= gclass::oid and attname =3D 'oid';
DELETE 1
mydata=3D# \d+ a_very_large_= table_with_oids;
&nbs= p;         Table "public.a_very_large_table_with_oids"
 Col= umn | Type | Modifiers | Storage  | Stats target | Description 
--------+------+-----------+----------+--------------+-------------
 k      | text | not null  | extended |  =             | 
 v   = ;   | text |           | extended | = ;             | 
Indexes:<= /div>
    "a_very_large_table_with_oids_pkey" PRIMARY= KEY, btree (k)

mydata=3D# select oid,* fro= m a_very_large_table_with_oid= s;
ERROR:  column "oid" does not exist

So far so good. I can inse= rt update and delete rows, but the table structure on disk is unchanged.&nb= sp;

So after those modifications I repack the table with vanilla pg_= repack. That copies the data to a fresh new table, sans oids.

Before I start performing these operations on= -line on the production data I wanted some expert eyes on this process sinc= e this is mission critical stuff. On the very large tables we will be in th= is limbo state for an extended period of time where pg_class and pg_attribu= te will have those forced modifications while pg_repack works its magic. Is= there anything to be concerned about if insert/update/delete seems to be w= orking? My insert/update/deletes on the tables while pg_repack is running s= eem to work fine. I also tried this on tables that have toast tables attach= ed and upon first glance, everything seems to be in order.

What have I missed?


------=_Part_4840074_201613290.1701189998979--