Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Philip Warner
At 22:23 13/11/00 -0800, Stephan Szabo wrote: >Admittedly, having an SQLSTATE style error code would help once we had >that so you could actually figure out what the error was. Yep, that would be nice. >> Totally agree; transactions will keep locks. Release them as soon as the >> business rules

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Stephan Szabo
> >When you start a transaction, > >you're telling the backend "treat all of these statements as one, big, > >all or nothing event." > > This is actually contrary to the standard. Statements are atomic, and a > failed statement should not abort the TX: > > The execution of all SQL-statemen

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Philip Warner
At 14:08 13/11/00 -0600, Ross J. Reedstrom wrote: >On Mon, Nov 13, 2000 at 09:41:04PM +0200, Cristi Petrescu-Prahova wrote: >> Hello, >> >> I would like to insert a bunch of rows in a table in a transaction. Some of >> the insertions will fail due to constraints violation. When this happens, >> P

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Michael Teter
> Can someone show me how to create (and use) an int8 > sequence? >From what I can tell (both from docs and doing a describe on sequences in my database), a postgresql sequence is an int4, not an int8, and thus you are limited to a max of 2.1 billion values. If you require an int8 sequence, you'

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Cristi Petrescu-Prahova
Multiple transactions carry a price: one cannot isolate the insertions from other sessions. This is not desirable in my case. The second suggestion is valuable. Thanks, Cristi - Original Message - From: Edmar Wiggers <[EMAIL PROTECTED]> To: Cristi Petrescu-Prahova <[EMAIL PROTECTED]>; <[E

RE: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Edmar Wiggers
I believe the known mechanism to cope with errors inside transactions are savepoints. That doesn't seem to be the case, though. If you don't care if some inserts fail, then you have multiple transactions instead of just one (use autocommit). If you want a transaction, check existence before eac

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Ross J. Reedstrom
On Mon, Nov 13, 2000 at 09:41:04PM +0200, Cristi Petrescu-Prahova wrote: > Hello, > > I would like to insert a bunch of rows in a table in a transaction. Some of > the insertions will fail due to constraints violation. When this happens, > Postgres automatically ends the transaction and rolls bac

Re: [SQL] how to continue a transaction after an error?

2000-11-13 Thread Stephan Szabo
On Mon, 13 Nov 2000, Cristi Petrescu-Prahova wrote: > Hello, > > I would like to insert a bunch of rows in a table in a transaction. Some of > the insertions will fail due to constraints violation. When this happens, > Postgres automatically ends the transaction and rolls back all the previous >

[SQL] how to continue a transaction after an error?

2000-11-13 Thread Cristi Petrescu-Prahova
Hello, I would like to insert a bunch of rows in a table in a transaction. Some of the insertions will fail due to constraints violation. When this happens, Postgres automatically ends the transaction and rolls back all the previous inserts. I would like to continue the transaction and issue the

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
Marten Feldtmann wrote: > > Throw away all the "hardwired"-stuff and do it with software. I > once described an algorithm in one of this lists how to create > unique values for clients without minimum interaction with the > database. > > The result: query once in the beginning of your applicat

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Forest Wilkinson
On 13 Nov 2000 10:30:55 PST, Dr Frog wrote: >create sequnece seq_name ; > >there are additional options >start sql and type What are the "SQL" and "TYPE" options? I don't see reference to them in the docs. Can I use the TYPE option to create a sequence that's based in int8 (64 bit integer) in

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Dr Frog
On Mon, 13 Nov 2000 10:44:21 -0700, Steve Wampler said: > Poet/Joshua Drake wrote: > > > > >However, I also use Postgres (7.0.2) throughout this > > >application and it seems cleaner to me to keep the current > > >id value in a table and just use postgres to provide access > > >(with a tri

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
Poet/Joshua Drake wrote: > > >However, I also use Postgres (7.0.2) throughout this > >application and it seems cleaner to me to keep the current > >id value in a table and just use postgres to provide access > >(with a trigger function to increment the id on access). > > Why not a sequence? Can

Re: [SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Poet/Joshua Drake
>However, I also use Postgres (7.0.2) throughout this >application and it seems cleaner to me to keep the current >id value in a table and just use postgres to provide access >(with a trigger function to increment the id on access). Why not a sequence? >Is this reasonable? Is it fast? (I need

[SQL] Using a postgres table to maintain unique id?

2000-11-13 Thread Steve Wampler
Hi, I have a distributed application that needs unique 64-bit "id" values. The current implementation keeps the current value for this id in a file on one system and uses a process to provide access to this file via CORBA. However, I also use Postgres (7.0.2) throughout this application and it

Re: [SQL] shared memory problem

2000-11-13 Thread Tom Lane
Michael Teter <[EMAIL PROTECTED]> writes: > Perhaps there's some issue with the shared memory not > being freed quickly enough by the kernel? Never heard of that before. There is an issue with time delays on release of port addresses --- sometimes you may get a failure to bind() to a port addre

Re: [SQL] shared memory problem

2000-11-13 Thread Michael Teter
I'm not sure if this is related, and unfortunately I don't have the specific error in front of me, but on occasion when I restart postgresql, using $ /etc/rc.d/init.d/postgresql restart I'll see the shutdown message, then I'll see a shared memory creation error, which I think looked similar to t