Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Scott Marlowe
On Fri, Dec 30, 2011 at 6:19 PM, Samuel Gendler wrote: > > > On Fri, Dec 30, 2011 at 4:03 PM, Scott Marlowe > wrote: >> >> On Fri, Dec 30, 2011 at 4:19 PM, Tom Lane wrote: >> > Jan Bakuwel writes: >> >> Why-o-why have the PostgreSQL developers decided to do it this way...? >> > >> > Because sta

Re: [SQL] Nested custom types: array - unable to insert [SOLVED]

2011-12-30 Thread John L. Poole
On 12/30/2011 7:31 PM, David Johnston wrote: On Dec 30, 2011, at 21:53, John Poole wrote: I am trying to create a custom data type for phone numbers where I have a primary phone number and then an array of additional phone numbers qualified by certain types. Below is a set of SQL commands I

Re: [SQL] Nested custom types: array - unable to insert

2011-12-30 Thread David Johnston
On Dec 30, 2011, at 21:53, John Poole wrote: > I am trying to create a custom data type for phone numbers where > I have a primary phone number and then an array of additional > phone numbers qualified by certain types. > > Below is a set of SQL commands I used to set up my custom > types. I a

[SQL] Nested custom types: array - unable to insert

2011-12-30 Thread John Poole
I am trying to create a custom data type for phone numbers where I have a primary phone number and then an array of additional phone numbers qualified by certain types. Below is a set of SQL commands I used to set up my custom types. I am unable to insert into the array field and wonder if I have

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Jan Bakuwel
Hi, Thanks for all having responded to my mail. I understand there's no way around it at the moment so I'll have to start writing some code to deal with this behaviour. cheers! Jan smime.p7s Description: S/MIME Cryptographic Signature

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Samuel Gendler
On Fri, Dec 30, 2011 at 4:03 PM, Scott Marlowe wrote: > On Fri, Dec 30, 2011 at 4:19 PM, Tom Lane wrote: > > Jan Bakuwel writes: > >> Why-o-why have the PostgreSQL developers decided to do it this way...? > > > > Because starting and cleaning up a subtransaction is an expensive thing. > > If we

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Scott Marlowe
On Fri, Dec 30, 2011 at 4:19 PM, Tom Lane wrote: > Jan Bakuwel writes: >> Why-o-why have the PostgreSQL developers decided to do it this way...? > > Because starting and cleaning up a subtransaction is an expensive thing. > If we had auto-rollback at the statement level, you would be paying that

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Tom Lane
Jan Bakuwel writes: > Why-o-why have the PostgreSQL developers decided to do it this way...? Because starting and cleaning up a subtransaction is an expensive thing. If we had auto-rollback at the statement level, you would be paying that overhead for every statement in every transaction, whether

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Jan Bakuwel
Hi Leif, On 30/12/11 22:44, Leif Biberg Kristensen wrote: > Fredag 30. desember 2011 09.43.38 skrev Jan Bakuwel : > >> Would be nice to have an option in PostgreSQL something along the lines >> of: 'abort-transaction-on-constraint-violation = false' > That option is called MySQL with MyISAM

Re: [SQL] avoid the creating the type for setof

2011-12-30 Thread John Fabiani
On Friday, December 30, 2011 06:26:19 AM John Fabiani wrote: > Hi, > I recall somewhere I saw a simple plpgsql function that returned a table > with more than one record that did not use a defined type or a temp table ( > at least I think I did). Is it possible to create such a function that > wil

Re: [SQL] avoid the creating the type for setof

2011-12-30 Thread Adrian Klaver
On Friday, December 30, 2011 6:26:19 am John Fabiani wrote: > Hi, > I recall somewhere I saw a simple plpgsql function that returned a table > with more than one record that did not use a defined type or a temp table > ( at least I think I did). Is it possible to create such a function that > will

Re: [SQL] avoid the creating the type for setof

2011-12-30 Thread Thomas Kellerer
John Fabiani wrote on 30.12.2011 15:26: Hi, I recall somewhere I saw a simple plpgsql function that returned a table with more than one record that did not use a defined type or a temp table ( at least I think I did). Is it possible to create such a function that will return more than one record

[SQL] avoid the creating the type for setof

2011-12-30 Thread John Fabiani
Hi, I recall somewhere I saw a simple plpgsql function that returned a table with more than one record that did not use a defined type or a temp table ( at least I think I did). Is it possible to create such a function that will return more than one record and not require a record type or temp

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Leif Biberg Kristensen
Fredag 30. desember 2011 05.25.22 skrev Jan Bakuwel : > Of course I can start testing existing values in the database before > accepting them in the user interface but that's putting the horse behind > the cart. I much rather use the constraints at the database level to > tell me a particular upda

[SQL] Re: Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Thomas Kellerer
Marcin Mirosław wrote on 30.12.2011 12:07: Would be nice to have an option in PostgreSQL something along the lines of: 'abort-transaction-on-constraint-violation = false' That option is called MySQL with MyISAM tables. Not true. Oracle and others (I believe at least DB2) behave such tha

Re: [SQL] Re: Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Marcin Mirosław
W dniu 30.12.2011 12:03, Thomas Kellerer pisze: > Leif Biberg Kristensen wrote on 30.12.2011 10:44: >> Fredag 30. desember 2011 09.43.38 skrev Jan Bakuwel : >> >>> Would be nice to have an option in PostgreSQL something along the lines >>> of: 'abort-transaction-on-constraint-violation = false'.

[SQL] Re: Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Thomas Kellerer
Leif Biberg Kristensen wrote on 30.12.2011 10:44: Fredag 30. desember 2011 09.43.38 skrev Jan Bakuwel : Would be nice to have an option in PostgreSQL something along the lines of: 'abort-transaction-on-constraint-violation = false' That option is called MySQL with MyISAM tables. Not

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Leif Biberg Kristensen
Fredag 30. desember 2011 09.43.38 skrev Jan Bakuwel : > Would be nice to have an option in PostgreSQL something along the lines > of: 'abort-transaction-on-constraint-violation = false' That option is called MySQL with MyISAM tables. Seriously, if the user encounters a constraint violation

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Jan Bakuwel
Hi David, > Start a "savepoint" before each sub-update and rollback to the savepoint if > the update fails, and then try again with different data. If it succeeds you > then release the savepoint anad move on. Yeah... not ideal in my case & will result in "messy" code... Would be nice to hav