[Gambas-user] Transaction processing in Postgresq
alan
alan at ...833...
Tue Feb 8 12:01:33 CET 2005
On Thursday 03 February 2005 12:13, alan wrote:
>> I am trying to move an ACCESS database to GAMBAS & POSTGRESQL.
>> As part of this process I want to change the order of the rows in some
>> of the tables
>> to match the order of the primary key.
>>
>> The following SQL command when submitted via PGADMINIII will achive
>> this objective:-
>>
>> BEGIN;
>> SELECT * INTO TEMP footemp FROM foo ORDER BY foo_id;
>> DELETE FROM foo;
>> INSERT INTO foo SELECT * FROM footemp;
>> DROP TABLE footemp;
>> COMMIT;
>>
>> This process has to be performed inside a transaction because there are
>> constrants
>> in other tables in the database which require some of the values in foo.
>>
>> When i try to execute the sql commands from within gambas the
>> transaction fails
>> at the first deletion with an error indicating a broken constaint.
>>
>> Does this mean gambas connot handle transactions?
>>
>> alan
>>
>
>
Transactions are supported!
Send me your code so that I can see which SQL commands are send to the
database driver...
Regards,
-- Benoit Minisini sorry to trouble you with this problem which i have
now found is due to a missing SQL command. There should be:- SET
CONSTAINTS ALL DEFERRED after tehe BEGIN regards Alan Bromley
More information about the User
mailing list