Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMhoz-0003j1-Ky for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2019 00:14:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iMhnx-00017j-CD for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2019 00:13:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMhnx-00017b-2S for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2019 00:13:41 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMhnq-0001sl-6G for pgsql-general@postgresql.org; Tue, 22 Oct 2019 00:13:40 +0000 Received: from panix2.panix.com (panix2.panix.com [166.84.1.2]) by mailbackend.panix.com (Postfix) with ESMTP id 46xv9l401PzsDX for ; Mon, 21 Oct 2019 20:13:31 -0400 (EDT) Received: by panix2.panix.com (Postfix, from userid 17622) id 46xv9l2y1cz1ZVj; Mon, 21 Oct 2019 20:13:31 -0400 (EDT) Date: Mon, 21 Oct 2019 20:13:31 -0400 From: stan To: pgsql-general@postgresql.org Subject: A question about sequences and backup/restore cycles Message-ID: <20191022001331.GC10733@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim User-Agent: Mutt/1.12.1 (2019-06-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I typically design a system with primary keys defined, like this: CREATE TABLE employee ( employee_key integer DEFAULT nextval('employee_key_serial') PRIMARY KEY , I use scripts to build the database structures and load the data. I am careful to get the dependencies in the correct order, so that the keys later structures depend on already exist. Today I was going over the design for the current project with a friend, whose expertise i respect. he said that he had issues on a system designed by an OEM that had dependencies on keys developed from sequences after a backup/restore cycle, Will I potentially have these issues? If so, what can I do different to avoid this being an issue? -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin