Re: [GENERAL] Problems with transactions and sequences

2003-08-29 Thread Bruno Wolff III
On Thu, Aug 28, 2003 at 08:22:47 -0700, Dennis Gearon <[EMAIL PROTECTED]> wrote: > if one gives a value for the seirial field, the trigger for the serial > on that table doesn't generate another value? Serials are implemented using a default function, not a trigger. ---

Re: [GENERAL] Problems with transactions and sequences

2003-08-29 Thread Bruno Wolff III
On Thu, Aug 28, 2003 at 21:10:19 +0530, Shridhar Daithankar <[EMAIL PROTECTED]> wrote: > > Actually I have no idea if you can insert specific value in a serial field. I > wouldn't be surprised if it works as intended but don't have a postgresql > installation handy here. (Working in windows ri

Re: [GENERAL] Problems with transactions and sequences

2003-08-29 Thread Lanette Miller
> You need to extract the current val first and explicitly use it in insert > statement. That way you won't have to produce work-arounds later.. This statement is wrong. If you were going to use this method ( getting the value first - then setting it), I believe you would need to call nextval not

Re: [GENERAL] Problems with transactions and sequences

2003-08-28 Thread Sune Nielsen
On Thu, 28 Aug 2003 20:24:43 +0530, [EMAIL PROTECTED] ("Shridhar Daithankar") wrote: >On 28 Aug 2003 at 14:35, Sune Nielsen wrote: >> INSERT INTO Users (name) VALUES ('JohnDoe'); >> SELECT CURRVAL('users_bid_seq'); >> >> This works perfectly(!), but my project involves multiple simultanous >> use

Re: [GENERAL] Problems with transactions and sequences

2003-08-28 Thread Shridhar Daithankar
On 28 Aug 2003 at 8:22, Dennis Gearon wrote: > if one gives a value for the seirial field, the trigger for the serial > on that table doesn't generate another value? If you are going to get sequence value first and insert it later, you can just declare it int8 rather than serial..:-) Would tha

Re: [GENERAL] Problems with transactions and sequences

2003-08-28 Thread Dennis Gearon
if one gives a value for the seirial field, the trigger for the serial on that table doesn't generate another value? Shridhar Daithankar wrote: On 28 Aug 2003 at 14:35, Sune Nielsen wrote: INSERT INTO Users (name) VALUES ('JohnDoe'); SELECT CURRVAL('users_bid_seq'); This works perfectly(!), b

Re: [GENERAL] Problems with transactions and sequences

2003-08-28 Thread Shridhar Daithankar
On 28 Aug 2003 at 14:35, Sune Nielsen wrote: > INSERT INTO Users (name) VALUES ('JohnDoe'); > SELECT CURRVAL('users_bid_seq'); > > This works perfectly(!), but my project involves multiple simultanous > users so I have to use transactions like this: > > BEGIN; > INSERT INTO Users (name) VALUES ('

Re: [GENERAL] Problems with transactions and sequences

2003-08-28 Thread Tom Lane
Sune Nielsen <[EMAIL PROTECTED]> writes: > Now, the problem is that I wish to extract the sequence number from a > newly inserted user, like this: > INSERT INTO Users (name) VALUES ('JohnDoe'); > SELECT CURRVAL('users_bid_seq'); > This works perfectly(!), but my project involves multiple simultan

[GENERAL] Problems with transactions and sequences

2003-08-28 Thread Sune Nielsen
Hello All! Im suffering an appearantly common problem with psql, although I haven't been able to locate the proper solution. Using phpPgAdmin I've created a relation (note: this relation is grossly simplified but the problem remains the same) : CREATE TABLE Users ( bid SERIAL, name

Re: [GENERAL] problems with transactions

2000-08-31 Thread Jules Bean
On Thu, Aug 31, 2000 at 09:43:52AM -0300, Campbell, Scott wrote: > > $sth = $dbh->prepare("begin work"); > $sth->execute(); > [snip error] > > after seeing this I assumed that you just can't use the begin statement > accross the DBI but there has to be a way of opening a transaction (it even

[GENERAL] problems with transactions

2000-08-31 Thread Campbell, Scott
I'm having problems opening a transaction through perl DBI When I try to execute "begin work" using the DBI prepare and execute functions I get an error: $sth = $dbh->prepare("begin work"); $sth->execute(); returns this error when I run the perl script from a prompt: please use DBI functions fo

[GENERAL] problems with transactions in C++Builder

2000-07-03 Thread igor
Greatings! Help me please to resolve my problem. As appeared, postgesql server doesn't rollback transaction in C++ Builder environment. May be sombody have an idea, how to make it work? The test source in the bottom of the letter. I will be very greatefull for any help. Igor.

[GENERAL] problems with transactions in C++Builder

2000-06-28 Thread igor
Greatings! Help me please to resolve my problem. As appeared, postgesql server doesn't rollback transaction, when I use C++ Builder environment. May be sombody have an idea, how to make it work? The test source in the bottom of the letter. I will be very greatefull for any help. Igor. ===