Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-09 Thread 邓尧
On Mon, Jan 9, 2012 at 9:53 AM, Jon Nelson wrote: > On Sun, Jan 8, 2012 at 7:13 PM, 邓尧 wrote: > > I have enabled the autocommit feature of psycopg2, and removed all the > > transactions in source code, also changed the sql statement to the > > following: > > > > insert into ACCOUNT(HOME) > >

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-08 Thread Jon Nelson
On Sun, Jan 8, 2012 at 7:13 PM, 邓尧 wrote: > I have enabled the autocommit feature of psycopg2, and removed all the > transactions in source code, also changed the sql statement to the > following: > > insert into ACCOUNT(HOME) >     select "v1" as HOME >     where not exists (select 1 from ACCOUNT

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-08 Thread 邓尧
I have enabled the autocommit feature of psycopg2, and removed all the transactions in source code, also changed the sql statement to the following: insert into ACCOUNT(HOME) select "v1" as HOME where not exists (select 1 from ACCOUNT where HOME = "v1") Surprisingly, I still got the uniqu

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-04 Thread Daniele Varrazzo
On Wed, Jan 4, 2012 at 8:09 PM, Alban Hertroys wrote: > On 4 Jan 2012, at 3:03, 邓尧 wrote: >> True, I don't need transactions, neither do I want them, but psycopg2 create >> transactions for me automatically :-( > > Well, if psycopg didn't, Postgres would wrap each statement in a transaction >

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-04 Thread Alban Hertroys
You accidentally clicked "Reply" instead of "Reply-all" ;) On 4 Jan 2012, at 3:03, 邓尧 wrote: >> On Tue, Jan 3, 2012 at 3:42 PM, Alban Hertroys wrote: >> On 3 Jan 2012, at 5:20, 邓尧 wrote: >> >> > Hi, >> > >> > I'm new to pgsql, I need the do something like the "INSERT IGNORE" in >> > mysql. Aft

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-03 Thread Merlin Moncure
On Tue, Jan 3, 2012 at 1:42 AM, Alban Hertroys wrote: > On 3 Jan 2012, at 5:20, 邓尧 wrote: > >> Hi, >> >> I'm new to pgsql, I need the do something like the "INSERT IGNORE" in mysql. >> After some searching I got a solution, which is adding a "do instead >> nothing" rule to the corresponding tabl

Re: [GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-02 Thread Alban Hertroys
On 3 Jan 2012, at 5:20, 邓尧 wrote: > Hi, > > I'm new to pgsql, I need the do something like the "INSERT IGNORE" in mysql. > After some searching I got a solution, which is adding a "do instead nothing" > rule to the corresponding table, but it fails sometimes. Yeah, if a concurrent transaction

[GENERAL] Duplicated entries are not ignored even if a "do instead nothing" rule is added.

2012-01-02 Thread 邓尧
Hi, I'm new to pgsql, I need the do something like the "INSERT IGNORE" in mysql. After some searching I got a solution, which is adding a "do instead nothing" rule to the corresponding table, but it fails sometimes. The table and the rule is created with the following sql statements: create seque