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)
> >
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
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
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
>
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
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
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
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