Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 203559FBCD3 for ; Tue, 26 Jun 2007 12:11:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 10707-07 for ; Tue, 26 Jun 2007 12:11:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id A0A3C9FBC48 for ; Tue, 26 Jun 2007 12:11:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from power2u.goelsen.net (mail.goelsen.net [195.202.170.130]) by svr4.postgresql.org (Postfix) with ESMTP id 029795AF5CE for ; Tue, 26 Jun 2007 15:11:38 +0000 (GMT) X-Envelope-From: michael.monnerie@it-management.at Received: from localhost (localhost [127.0.0.1]) by power2u.goelsen.net (Postfix) with ESMTP id BD76A8264A for ; Tue, 26 Jun 2007 17:11:29 +0200 (CEST) Received: from power2u.goelsen.net ([127.0.0.1]) by localhost (power2u.goelsen.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16425-09 for ; Tue, 26 Jun 2007 17:11:18 +0200 (CEST) X-Envelope-From: michael.monnerie@it-management.at Received: from mailsrv.i.zmi.at (h081217116113.dyn.cm.kabsi.at [81.217.116.113]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mailsrv.i.zmi.at", Issuer "mailsrv.i.zmi.at" (not verified)) by power2u.goelsen.net (Postfix) with ESMTP id 98858821AE for ; Tue, 26 Jun 2007 17:11:08 +0200 (CEST) From: Michael Monnerie Organization: it-management http://it-management.at To: pgsql-admin@postgresql.org Subject: How to set a constraint on non-unique fields? Date: Tue, 26 Jun 2007 17:11:06 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4034818.CdxQJeqUBv"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200706261711.06656@zmi.at> X-Virus-Scanned: amavisd-new at goelsen.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=AWL=-0.000, BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200706/272 X-Sequence-Number: 25940 --nextPart4034818.CdxQJeqUBv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi list, I hope this is not OT here, but I'm no SQL guru and sure some=20 know this. I have two tables: (just in short format) multilang (id int, language int, text text); types (id int, textid references multilang(id) on delete restrict); But that doesn't work out, because "id" in multilang is not unique. For=20 one "id", there can be several "language" values, having a text in that=20 language. Now in table types, I want to make sure that "textid" MUST=20 exist in multilang, and cannot be deleted when having references. How=20 would I do that? mfg zmi =2D-=20 // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0676/846 914 666 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: EA39 8918 EDFF 0A68 ACFB 11B7 BA2D 060F 1C6F E6B0 // Keyserver: www.keyserver.net Key-ID: 1C6FE6B0 --nextPart4034818.CdxQJeqUBv Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBGgSyKui0GDxxv5rARAvp8AKCiRTeWYHLRInLo2om3YFnpa9zjkACdElD9 qNBi41fEgZhruD/4sjbd0Zg= =6VHw -----END PGP SIGNATURE----- --nextPart4034818.CdxQJeqUBv--