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 1qIeQB-0003qu-0M for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 00:06:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qIeQ9-0003Tp-MI for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 00:06:29 +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 1qIeQ9-0003Tg-Bp for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 00:06:29 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIeQ6-002yJG-LD for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 00:06:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E21695C040B; Sun, 9 Jul 2023 20:06:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 09 Jul 2023 20:06:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1688947585; x=1689033985; bh=2xLLAzvP0/gGqcmQBqGH7Iz++zk9SHP2oJB W15xsX7c=; b=fawkn7Ay3okGuPx/1C4TRPcCnaz49BFTe94rUfBFmgacgYxNFpA 8ADYr8VR3AZei3HjiMnFxGIZ+mhK+LB+thlbbS8ks7EMT3GBb+Tfm/LJwPEGAdOW N5/pUBS7IfSkzieP7XMPdUjmBFBFn8KC6SmSTXpKDzy7zsbXLVTBhx6GaEK1fZvu sWCblzDdY/qevGC39hsQWsWsDBC2BBtm6QjjGbzMDHmGajWC9UauQQSSwtZNTK27 amGLHrbcp1gODsbJAJNgjxNtEncPDhVGLWYl9a5S7mxcDJA1She7IMJHb3O4Yx8J QVUIXsj/oyTtJ45r/scY8e9C2AcpUwGcPgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1688947585; x= 1689033985; bh=2xLLAzvP0/gGqcmQBqGH7Iz++zk9SHP2oJBW15xsX7c=; b=V ihUjoR7SJxsgJqZAtr7RHL6TXz/9FhvsUcD71g1EJTz0UAUl4L0sUyUM+6IsTUry NZ68lVoaUi/LkWImYawdtCNevm4YF2Txn4cSygCZ+jBkVDl0dJoJmvuqMEPKq0gT u89FnBg25Ta6jKIis+HOSK+sbmjPXKZSFhM2orWJESWRWCg5o5h3rdu7eu72bQre aciDPhJYOEcSbUpeHAb10BovoyXozIjh5vIx8HEV35I4+GmwY2HN63OPJ7FAwGLb S+97GMJQu2PGsgPtHx0mZyJJiiMalSWcoZXkb5wkpf8LJiGdIRJGFLvWxlMsPP7r FjB8vkwFZBdsUG4VQeezQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrvdeigdefvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffhvfhfjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeekueetuedtve euteeggefhkedthffhveejfffgtdeljeejheelveefhfegudefueenucffohhmrghinhep fihhrghttghomhgtohhunhhthidruhhsnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdr tghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Jul 2023 20:06:25 -0400 (EDT) Message-ID: Date: Sun, 9 Jul 2023 17:06:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: INSERT UNIQUE row? Content-Language: en-US From: Adrian Klaver To: pf@pfortin.com, pgsql-general@lists.postgresql.org References: <20230709185807.1bc9afd9.pfortin@pfortin.com> <0b2061ad-1a27-d2df-44f6-3af87edf9b6e@aklaver.com> In-Reply-To: <0b2061ad-1a27-d2df-44f6-3af87edf9b6e@aklaver.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/9/23 17:04, Adrian Klaver wrote: > On 7/9/23 15:58, pf@pfortin.com wrote: >> Hi, >> >> Trying to figure out how to insert new property addresses into an >> existing table. >> >> Can a UNIQUE constraint be applied to an entire row?  Adding UNIQUE to >> each column won't work in such a case since there are multiple properties >> * on the same street >> * in the same town >> * with the same number on different streets >> * etc... > > Does the locality you are in have something like the Property ID# and/or > Parcel # / Geo ID shown here: > > https://property.whatcomcounty.us/propertyaccess/PropertySearch.aspx?cid=0 Should have added, can you create your own surrogate PK to fill the same role? > >> >> Each row is only unique as an entity; but the columns are not... >> >> Is this covered in the docs? >> >> Thanks, >> Pierre >> >> >> > -- Adrian Klaver adrian.klaver@aklaver.com