Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 11231635D0D for ; Fri, 11 Sep 2009 10:33:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15811-02 for ; Fri, 11 Sep 2009 13:32:54 +0000 (UTC) X-Greylist: delayed 00:06:39.363122 by SQLgrey-1.7.6 Received: from web39808.mail.mud.yahoo.com (web39808.mail.mud.yahoo.com [209.191.106.69]) by mail.postgresql.org (Postfix) with SMTP id 24579635BD8 for ; Fri, 11 Sep 2009 10:32:55 -0300 (ADT) Received: (qmail 79282 invoked by uid 60001); 11 Sep 2009 13:26:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1252675573; bh=T3I4RWHB8dkOZRsUjy6wt0Msxjy94ZJJsJ5PvcsCrHo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=y6QroAAK3mMv+650+IzlHEJod+OtkShVXMh0ppDmTRR6XjVj39NL+LB4D7Go4TLIppmYOgM4/GZwZ6xq8M0G7mZ3AItjDC/ypJ2brE7XFUtFJDNH9nts9e5qRAEwv5yaTtaMIQL9/Mwe/VmhmQGC/V9KAgtyZ3Xk869rwJZheIQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=ww4IgO3lCDoAf12zR48RuG0gtuRQgM9jmyKOeAK/vy+qRtm5Ly7clBxAG9s/CFzlhMtQg+/kNXdwDfZyEgqpiUksnzwRusoSaMeVgRfr6POIOFI+OoAl0VBLtnocVt/QvMaJmCNrOOoQtr7iofgHPC3LuYVdKc+3Okp8Yo6NEoU=; Message-ID: <793249.77906.qm@web39808.mail.mud.yahoo.com> X-YMail-OSG: ZqIMtE0VM1mThY23YDfEtmZ0UXSfSUAobWqJOeTU32.9xGkxrNr6Gnil9_DjSYp.Bdw9Nkr_2qOqyzVCcTpvP6ywwGnaaWrf784iGAYX4s4uawHiCelXM1rOjGJ5ItKfn9D3Hd39drNCR9FF3ViDBi1goAJUsvZTRV3tLjC7A.B7wPEKvOqqsiTRaH8s6Kq.pVDixjTymytmwIdszRTChAhv.oWdyldDnBs0zRgWCnYO06t5pqRKGC5PSPDhMW2hx_hfXDpEr20_65.zJgbXG5Rg_8iEf7Wc2PvzURAgzRjkPRLc76T8Rqbxx2EP3IAmFlx4rapEWcMlXzMVSe8P Received: from [212.149.174.210] by web39808.mail.mud.yahoo.com via HTTP; Fri, 11 Sep 2009 06:26:13 PDT X-Mailer: YahooMailRC/157.18 YahooMailWebService/0.7.347.2 Date: Fri, 11 Sep 2009 06:26:13 -0700 (PDT) From: Janne Subject: Serious problems with non-primary foreign keys To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1713984946-1252675573=:77906" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200909/53 X-Sequence-Number: 33118 --0-1713984946-1252675573=:77906 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I'm having some serious problems using PostgreSQL with symfony and Doctrine= . Here is the error that I've been fighting with for the last couple of day= s: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transactio= n is aborted, commands ignored until end of transaction block. Failing Quer= y: CREATE INDEX company_id ON sf_guard_user_profile (company_id) It seems t= o affect every single non-primary foreign key. Turning the key to primary f= oreign fixes the problem but I don't want it to be primary. I can't think o= f any logical reason why this error would happen. Generally there's nothing= wrong with using a non-primary (not null) foreign key. But Postgre seems t= o think there is. I know PostgreSQL creates an index for every primary key.= Since turning the key also into primary seems to fix it, should I just def= ine an index for it? I've tried it but nothing changes. Here's the relevant= SQL:=0ACREATE TABLE sf_guard_user_profile (id BIGINT, company_id BIGINT NO= T NULL, PRIMARY KEY(id));=0ACREATE TABLE company (company_id INT, PRIMARY K= EY(company_id)); Any ideas on how to fix this?=0AThank you,=0Ajanneaa=0A=0A= =0A --0-1713984946-1252675573=:77906 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I'm havin= g some serious problems using PostgreSQL with symfony and Doctrine. Here is= the error that I've been fighting with for the last couple of days:=0A=0AS= QLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is= aborted, commands ignored until end of transaction block. Failing Query: C= REATE INDEX company_id ON sf_guard_user_profile (company_id)=0A=0AIt seems = to affect every single non-primary foreign key. Turning the key to primary = foreign fixes the problem but I don't want it to be primary.=0A=0AI can't t= hink of any logical reason why this error would happen. Generally there's n= othing wrong with using a non-primary (not null) foreign key. But Postgre s= eems to think there is.=0A=0AI know PostgreSQL creates an index for every p= rimary key. Since turning the key also into primary seems to fix it, should= I just define an index for it? I've tried it but nothing changes.=0A=0AHer= e's the relevant SQL:=0ACREATE TABLE sf_guard_user_profile (id BIGINT, comp= any_id BIGINT NOT NULL, PRIMARY KEY(id));=0ACREATE TABLE company (company_i= d INT, PRIMARY KEY(company_id));=0A=0AAny ideas on how to fix this?=0AThank= you,=0Ajanneaa

= =0A=0A=0A=0A --0-1713984946-1252675573=:77906--