Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-16 Thread Peter J. Holzer
On 2020-05-12 21:55:56 +0100, Peter Devoy wrote: > >Is is possible to have two entries which have the same > >address_identifier_general, street and postcode, but different > >descriptions? > > Unfortunately, yes. The data comes from gov't systems to > regulate the development/alteration of arbit

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread David Goodenough
: Peter J. Holzer > Cc: pgsql-general@lists.postgresql.org > Subject: Re: Enforcing uniqueness on [real estate/postal] addresses > > Think Before You Click: This email originated outside our organization. > > > > >Is is possible to have two entries which have the same

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Basques, Bob (CI-StPaul)
AM To: pgsql-general@lists.postgresql.org Subject: RE: Enforcing uniqueness on [real estate/postal] addresses Think Before You Click: This email originated outside our organization. On Wed, 13 May 2020, Basques, Bob (CI-StPaul) wrote: > Was wondering if you ever thought about binding the textual

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Rich Shepard
On Wed, 13 May 2020, Basques, Bob (CI-StPaul) wrote: Was wondering if you ever thought about binding the textual address to a USNG location. https://usngcenter.org/ Bobb, et al.: Why not have a 'parent' table with entries such as 'Foo Farm' and a 'child' table with rows for sub-parts of the p

RE: Enforcing uniqueness on [real estate/postal] addresses

2020-05-13 Thread Basques, Bob (CI-StPaul)
: pgsql-general@lists.postgresql.org Subject: Re: Enforcing uniqueness on [real estate/postal] addresses Think Before You Click: This email originated outside our organization. >Is is possible to have two entries which have the same >address_identifier_general, street and postcode, but different >desc

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-12 Thread Adrian Klaver
On 5/12/20 1:55 PM, Peter Devoy wrote: Is is possible to have two entries which have the same address_identifier_general, street and postcode, but different descriptions? Unfortunately, yes. The data comes from gov't systems to regulate the development/alteration of arbitrary pieces of propert

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-12 Thread Rich Shepard
On Tue, 12 May 2020, Peter Devoy wrote: Is is possible to have two entries which have the same address_identifier_general, street and postcode, but different descriptions? Unfortunately, yes. The data comes from gov't systems to regulate the development/alteration of arbitrary pieces of proper

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-12 Thread Karsten Hilbert
On Tue, May 12, 2020 at 09:55:56PM +0100, Peter Devoy wrote: > >Is is possible to have two entries which have the same > >address_identifier_general, street and postcode, but different > >descriptions? > > Unfortunately, yes. The data comes from gov't systems to > regulate the development/alterat

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-12 Thread Peter Devoy
>Is is possible to have two entries which have the same >address_identifier_general, street and postcode, but different >descriptions? Unfortunately, yes. The data comes from gov't systems to regulate the development/alteration of arbitrary pieces of property and those pieces do not always have a

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-12 Thread Peter J. Holzer
On 2020-05-12 10:49:22 +1000, Tim Cross wrote: > Peter Devoy writes: > > I need to store addresses for properties (as in real estate) so in my > > naivety I created a unique constraint like this: > > > > ALTER TABLE properties > > ADD CONSTRAINT is_unique_address > > UNIQUE ( > > d

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread Tim Cross
Peter Devoy writes: > Hi list > > I need to store addresses for properties (as in real estate) so in my > naivety I created a unique constraint like this: > > ALTER TABLE properties > ADD CONSTRAINT is_unique_address > UNIQUE ( > description, --e.g. Land north of Foo Cottage >

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread Peter Devoy
Hello everyone Thank you all for your suggestions. I had neither heard of partial unique indexes nor considered using COALESCE so I will explore both of these as options and update the thread with how it goes. >Then, if you can define a problem where you feel having a unique table >constraint o

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread Paul Jungwirth
On 5/11/20 9:55 AM, Peter Devoy wrote: Of course, if any of the fields are NULL (which they often are) I end up with duplicates. One solution may be to add NOT NULL constraints and use empty strings instead of NULL values but, until asking around today, I thought this was generally considered ba

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread David G. Johnston
On Mon, May 11, 2020 at 9:56 AM Peter Devoy wrote: > I need to store addresses for properties (as in real estate) so in my > naivety I created a unique constraint like this: > > ALTER TABLE properties > ADD CONSTRAINT is_unique_address > UNIQUE ( > description, --e.g. Land north o

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread Adrian Klaver
On 5/11/20 9:55 AM, Peter Devoy wrote: Hi list I need to store addresses for properties (as in real estate) so in my naivety I created a unique constraint like this: ALTER TABLE properties ADD CONSTRAINT is_unique_address UNIQUE ( description, --e.g. Land north of Foo Cottage

Re: Enforcing uniqueness on [real estate/postal] addresses

2020-05-11 Thread Philip Semanchuk
> On May 11, 2020, at 12:55 PM, Peter Devoy wrote: > > Hi list > > I need to store addresses for properties (as in real estate) so in my > naivety I created a unique constraint like this: > > ALTER TABLE properties >ADD CONSTRAINT is_unique_address >UNIQUE ( >description, --e