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 1jtXe9-0004Ur-7S for pgsql-admin@arkaria.postgresql.org; Thu, 09 Jul 2020 14:35:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtXe8-0007cb-41 for pgsql-admin@arkaria.postgresql.org; Thu, 09 Jul 2020 14:35:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtXe7-0007bs-Mh for pgsql-admin@lists.postgresql.org; Thu, 09 Jul 2020 14:35:31 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtXe0-0003wo-Am for pgsql-admin@postgresql.org; Thu, 09 Jul 2020 14:35:30 +0000 Received: by mail-wr1-x443.google.com with SMTP id q5so2642371wru.6 for ; Thu, 09 Jul 2020 07:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=2aB9paAqgbW6/sDspG5U2H4r6eKkUuwxR7scUgQpUhg=; b=j25ed6fJbgPQy/7tzKychm/qiR73JQMyE45kisa7TKxRGyoJlT95wwy1e6pzxleeGV sEGx34WiqHsjIqui5iMwXzeoNp6M8tT8M0ne79b1t2Whyc+ltRveHdVcT1rur1PlQR1F /vpNUKOWTdEhZhA2sTRj6t6qdogXtw8kbQrj0Vb0agEIGb7os8nMtJ0MHjdXYbyjQLD0 n1v7lYgrxTNFLl7ir4NagcODLvWx74sprJ4P1HPef2XhzcgnIa17Lg8+UCiWpF+B7ihS mPcE8OR0hM61yzALE+dnZ7uX9jGWTAgpAnv9yc+XK5kfveZ+4DRgnSkVoP9egouqW8uY BTcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=2aB9paAqgbW6/sDspG5U2H4r6eKkUuwxR7scUgQpUhg=; b=cRQNRetXg8/DJzU5Pkp7QvYDUtkpwfr2J1SCT+Vq6vbsKY8jb6WsvF84ecl3YputWh +l5vEjaHV+F18pzz0EfRJm3CBb3Bxs3YUWPmlDmY9ed7p7QvfyN2fi47kgui/OdO5BUz JstMtRtjydVv+Ub7tyTNfUbDyC1rgqw2MeFTcU72MmP/48XuxS987wXrkrPdBZHIJeH8 0rQ2Y7Jvla/AL7VOcEIvwL7vBhSpeblYAn1SH2NEcJ/pVgBza4Bt5D1wY6/vk30sv7m2 APDHeo9N+yLhw05Sk2NzwTP8bMX/hIEZZOLY1/8g/rF8tgtIi/dE78FX0dSiWKnnymDF E9ag== X-Gm-Message-State: AOAM533jCiZ7JO3/75NIFlNaKz9bfaZ27G5kCFvD0Yu2ETEPyfjHd+CV U5Fq8wIzTKNbuojRt0JimZYF4Q== X-Google-Smtp-Source: ABdhPJyNgoAHOcZwnudmAz2QIfxKWIt7o0p1N2En7r3L2vOpxkRwY9eGtn3HRibSGT905hBcLB3M0A== X-Received: by 2002:a5d:628b:: with SMTP id k11mr64398331wru.107.1594305322364; Thu, 09 Jul 2020 07:35:22 -0700 (PDT) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id a123sm5295795wmd.28.2020.07.09.07.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 07:35:21 -0700 (PDT) Message-ID: <0de7002c83377e9a0066dc9877c4e1892119289c.camel@cybertec.at> Subject: Re: how to conveniently upgrade with specific catalog change From: Laurenz Albe To: ZongtianHou , pgsql-admin Date: Thu, 09 Jul 2020 16:35:20 +0200 In-Reply-To: <0CC0149C-CD15-4A81-B4F1-5AF8E67E57FD@icloud.com> References: <99E3D554-1D96-42F0-9647-B7D2CECB3E7E@icloud.com> <1647744.1592576042@sss.pgh.pa.us> <0CC0149C-CD15-4A81-B4F1-5AF8E67E57FD@icloud.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-07-09 at 17:55 +0800, ZongtianHou wrote: > I am doing some development based on postgres(8.x.x) and encountered a problem when doing upgrade. Normally, there are two ways for me to do upgrade. > 1. when new version without catalog change, I can replace the binary and restart the cluster. > 2. when new version with catalog change like add a column or a row to a system table, I can replace > the binary and turn allow_system_table_mods to all, do all the changes, then restart. > > But, when new version add a new built-in datatype, like json, which will insert a row in pg_type with specific oid, > I can not find a simple way to do this. I look up the initdb code, it run the postgres program in bootstrap mode, > feed it data from postgres.bki file which support oid specification. Simplify the question, How can I do upgrade > conveniently if I just need to insert one row in one system table with specific oid? Can I do it in upgrade mode > somehow or I need to run some upgrade program?