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 1lq9AH-0007yB-B6 for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 06:55:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lq9AG-0002Cp-1S for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 06:55:12 +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 1lq9AF-0002Cg-OI for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 06:55:11 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lq9A8-0005UV-97 for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 06:55:10 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id D72254D60; Mon, 7 Jun 2021 08:55:01 +0200 (CEST) Date: Mon, 7 Jun 2021 08:55:01 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: index unique Message-ID: <20210607065501.GA17125@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-06-03 22:51:55 +0200, Marc Millas wrote: > postgres 12 with postgis. > on a table we need a primary key and to get a unique combinaison, we need= 3 > columns of that table: > 1 of type integer, > 1 of type text, > 1 of type geometry >=20 > creating the PK constraint doesn work: I find that if a natural primary key candidate is so complex, it is usually better to use a surrogate key.=20 hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmC9wsAACgkQ8g5IURL+ KF1KRw//dFaQjcdTymZg9Wm3F7nNp2hW70voSnqjmyZUFLjXOLqPT1yGv14Vf6C2 LfEXKXS7TUTE5m7fZ2bzJhgGbE3+zWJ7RWvALF00P/+9lb1E9OWUv/qVfxgeHQDD eKj0RN1R2L6Of+A4goNhUDKgPtG2tj3WtuzdPIexSbg0H+oe1MP8mPklTiV5zsuT jMiSbx920nlDRT9VFxgjBbVax0YdKFB+fc+wL56Sy9jEs8M1KLeZA+69upqcKcll Vb4V2ZzDbOWFXfAmSQxY/RrXxZX5xOIeVoUYBUYGsO5puimSU8reM7qBFRpbDBUZ PlKwrKj9D9oC6EHSOwzIPolhus32JpU5vsNGCEXc3qukz+OIZnsrNh3jqBk4DW55 bVLGJ0hIUVukgZGOz974+7ouFO6ReUI2fB6hiN22gRSOYl6ZPWm3psPpLUdXbTSX eObOe8VbpULxdBRRzAYsCXyIcLFW5Kw8TkQhoACnmy0hjaG+R/Fg7gouYpFLgBPM hH+w13JrBwzjafiXEfsEYutOuYB2ZO/S8tynXhb2sfyqfhX4vTUswq9JO+eaFptE nVr57VL/NKBmYfba9AQ3jwtLVav9tU4nmgFAMvIG9O1sFtMLtAS7wZ2XptMMVSiK 7OLVJYoDsG5yduosGVI7EycjzYjHBw/uaWIOTRuJZJo+cKeGd8U= =BOYF -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn--