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 1iMhyh-0003zc-My for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2019 00:24:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iMhyg-0005Qr-4X for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2019 00:24:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iMhye-0005Q7-9i for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2019 00:24:45 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iMhyb-0008OL-Fv for pgsql-general@postgresql.org; Tue, 22 Oct 2019 00:24:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BA896656; Mon, 21 Oct 2019 20:24:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 21 Oct 2019 20:24:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=D iEldSAyZBMff9NxqlUFO+HDDggUzOoOb/qMN7LiiBo=; b=l8lFwdq1BX5jt3BWR YhknLJ1O4BZ42nbRspJ1dBoyJ2cLWTHDuLvPsu6ONt918pHBzGdFQmLP1YDDjIE4 WlA6pZm9XAyymOlmnUrzRP8YXdfetm7yVVz2mmXJTsWefXhCwWHODVPo2Y5bEd7E rjQhofEk/f1LrLxKiNEDORruIJStcRytWmovwfE4TC+ZS+zDPQKiXbhfRE0D3Jm1 V7h9mwIhETT57V+Ae1ChMd3+gJ6Ababy79SdqNXEVyKj7gKmPByJ/qNMizqCX6+c ZHuC7/uhvlhV3SayyG4DuHFbt5lJLXGCNTriN7uWRjaehcFcQTAKMHBaQw19w00R PHO1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=DiEldSAyZBMff9NxqlUFO+HDDggUzOoOb/qMN7Lii Bo=; b=S9ZYZ+ddTZRo6jY5Qc6CtaqbLRjvOn6tllRfda9OqtfbnDa/gSMzids4f O6YEr1VWyXSx6vHXM35V/Sl6eajC2PDR9mT5nqI3v5Yvh/1WjEezNeKjGIcuDQiX DSInlVz3ncVxlymbt3MJRfwT+88n0n174E8WN13X1QlJDyamMeaPfFOGBkdGoBaQ 6v54cqlGCJvro2nFJACttEdgqDbtiDTKsRTuwi2soKQLJbbdMv1MwcjGsRXj0c8w 62mCE3nDGgX7ja2XgLIdk6sAOL27Oglucri3CXlQdE9r+DMo+P2fTVuHpcoB4gkK TJ3ErBGY/kq0Oc+Ro0JB86QAKUhcA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrkeeigdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepudejgedrvddurdelhedrledtne curfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghv vghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.2] (174-21-95-90.tukw.qwest.net [174.21.95.90]) by mail.messagingengine.com (Postfix) with ESMTPA id 6C2468005C; Mon, 21 Oct 2019 20:24:38 -0400 (EDT) Subject: Re: A question about sequences and backup/restore cycles To: stan , pgsql-general@postgresql.org References: <20191022001331.GC10733@panix.com> From: Adrian Klaver Message-ID: Date: Mon, 21 Oct 2019 17:24:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191022001331.GC10733@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/21/19 5:13 PM, stan wrote: > > 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? It is not clear to me what you are doing: 1) Are you using pg_dump/pg_restore to populate a database? If so it will take care of the dependencies. 2) Are you using a home built method to populate the database? In that case you take responsibility for dependencies. > > -- Adrian Klaver adrian.klaver@aklaver.com