Re: [SQL] help with version checking

2006-12-29 Thread Chris Dunworth
I'd probably make a small change to make this a little cleaner. Specifically, change check_version() to take an argument, which is the needed version, and check this against the current value in agenda_version, throwing the exception if they don't match. Once you've written this, you'll never

Re: [SQL] help with version checking

2006-12-28 Thread Chris Dunworth
Can you do the whole thing inside a transaction context (both the version check and the updates)? The exception should cause the transaction to bail out, and the updates won't proceed. Thus: BEGIN; SELECT check_version(); UPDATE agenda_version set version = '1.0.0.1' where id = 1; COMMIT; I t

Re: [SQL] Problem inserting composite type values

2006-12-01 Thread Chris Dunworth
Aaron Bono wrote: On 12/1/06, *Stephan Szabo* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: On Fri, 1 Dec 2006, Chris Dunworth wrote: > Hi all -- > > (huge apologies if this is a duplicate post -- I sent from an > unsubscribed email account

Re: [SQL] Problem inserting composite type values

2006-12-01 Thread Chris Dunworth
Stephan Szabo wrote: On Fri, 1 Dec 2006, Chris Dunworth wrote: Hi all -- (huge apologies if this is a duplicate post -- I sent from an unsubscribed email account before...) I have a problem trying to INSERT INTO a table by selecting from a function that returns a composite type. (I&#

[SQL] Problem inserting composite type values

2006-12-01 Thread Chris Dunworth
olumn, intVal. I'm obviously doing something wrong. Is there some way to format the INSERT so that I can get full rows inserted, with the individual columns separated out properly (e.g. intVal=3, newVal1=30, newVal2=38)? I'm still pretty new to all this, so it could be something simpl