pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: pf@pfortin.com
To: pgsql-general@lists.postgresql.org
Subject: Re: INSERT UNIQUE row?
Date: Mon, 10 Jul 2023 09:43:03 +0200 (CEST)
Message-ID: <1479974906.1082427.1688974983668@office.mailbox.org> (raw)
In-Reply-To: <20230709222539.116ee4b8@pfortin.com>
References: <20230709185807.1bc9afd9.pfortin@pfortin.com>
	<0b2061ad-1a27-d2df-44f6-3af87edf9b6e@aklaver.com>
	<20230709222539.116ee4b8@pfortin.com>

> 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





view thread (8+ messages)

Message-ID: <1479974906.1082427.1688974983668@office.mailbox.org>
Permalink:  ../1479974906.1082427.1688974983668@office.mailbox.org/
Also on:    postgresql.org/message-id/1479974906.1082427.1688974983668@office.mailbox.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ewie@ewie.name, pf@pfortin.com
  Subject: Re: INSERT UNIQUE row?
  In-Reply-To: <1479974906.1082427.1688974983668@office.mailbox.org>
  References: <20230709185807.1bc9afd9.pfortin@pfortin.com> <0b2061ad-1a27-d2df-44f6-3af87edf9b6e@aklaver.com> <20230709222539.116ee4b8@pfortin.com> <1479974906.1082427.1688974983668@office.mailbox.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox