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 1qIlYA-0000zu-8m for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 07:43:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qIlY9-0003et-5P for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 07:43:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qIlY8-0003ek-Of for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 07:43:12 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIlY6-003Eq5-Hp for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 07:43:12 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Qzww85LrNz9sQD; Mon, 10 Jul 2023 09:43:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1688974984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fQuPBC9r/TfG68mYQtChNLfgHcGrEyxnPyFRF7XegZ4=; b=u6IZ7mTJvM4dIXW0JpRO9G+uPZcvHvEpPWxH90YXYshElyS72lncm3UVyt72UPSXG/rDjQ hIKn5PDQHIJRJzKAk3QfRx09tldgTpl823OleZIGnp9l7jC4f+tyqg9C1Eq8LcaUMf33nX FG0NEAdJWgqJdnLHmna6jTxxZvn8fgdZhqjbB18bY8+W7TvFLhUIEv/gBCk/LfgMcUnKcZ rU7pvj4WdZ9F9yCbZLQYKuZXlLoGdt/6St22hfMy9WKUumGpdkoUy9yXNwmbycitUW/oQ+ dmSk3aLYYuVCdWzQQUak4RevPrXsYY9+iQfgA09+F3GCBhkJ838oQqsG2zcAJw== Date: Mon, 10 Jul 2023 09:43:03 +0200 (CEST) From: Erik Wienhold To: pf@pfortin.com, pgsql-general@lists.postgresql.org Message-ID: <1479974906.1082427.1688974983668@office.mailbox.org> In-Reply-To: <20230709222539.116ee4b8@pfortin.com> References: <20230709185807.1bc9afd9.pfortin@pfortin.com> <0b2061ad-1a27-d2df-44f6-3af87edf9b6e@aklaver.com> <20230709222539.116ee4b8@pfortin.com> Subject: Re: INSERT UNIQUE row? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4Qzww85LrNz9sQD List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 10/07/2023 04:25 CEST pf@pfortin.com wrote: > > On Sun, 9 Jul 2023 17:04:03 -0700 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 > > Thanks! Just getting started on this issue and this made me realize my > current data source may not be the best... Much appreciated! Also keep in mind that it's not trivial to model addresses, even in a single country. Some database constraints may become a footgun. https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/ -- Erik