Re: [GENERAL] any way for a transaction to "see" inserts done earlier in the transaction?

2014-04-20 Thread Rajeev rastogi
Was the function doing INSERT operation was successful? I suspect may be INSERT function has failed and hence INSERT got ABORTED. Also you can try to commit whole transaction and see if you are able to find the new id (This will prove that whether really new id was inserted or not). Thanks and R

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Rajeev rastogi
On 20 April 2014 02:21, Torsten Wrote: > Hi, > > an index can be INVALID (pg_index.indisvalid=false). > > I want to temporarily disable an index so that it won't be used to > access data but will still be updated. > > Can I simply set pg_index.indisvalid=false and later turn it true again? I

Re: [GENERAL] Non-deterministic 100% CPU hang on postgres 9.3

2014-04-20 Thread Fenn Bailey
Hi all, I was wondering if anyone had any further insight as to why the query plan would have changed so dramatically between queries, even when isolated by a transaction? Is it possible for database statistics to change after a query has been run (independent of transactions)? Thanks in advance

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Rob Sargentg
Sorry, I should not have top-posted (Dang iPhone). Continued below: On 04/20/2014 05:54 PM, Dorian Hoxha wrote: Because i always query the whole row, and in the other way(many tables) i will always join + have other indexes. On Sun, Apr 20, 2014 at 8:56 PM, Rob Sargent

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Dorian Hoxha
Because i always query the whole row, and in the other way(many tables) i will always join + have other indexes. On Sun, Apr 20, 2014 at 8:56 PM, Rob Sargent wrote: > Why do you think you need an array of theType v. a dependent table of > theType. This tack is of course immune to to most future

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Jeff Janes
On Apr 20, 2014 4:21 AM, "Torsten Förtsch" wrote: > > On 20/04/14 12:08, Thomas Kellerer wrote: > >> Example: > >> > >> btree (fmb_id, action_type) > >> btree (fmb_id) > >> > [...] > > > > Btw: in the above example the second one is definitely not needed. > > Any query that uses the seco

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Rob Sargent
Why do you think you need an array of theType v. a dependent table of theType. This tack is of course immune to to most future type changess. Sent from my iPhone > On Apr 20, 2014, at 11:57 AM, Dorian Hoxha wrote: > > Was just curious about the overhead. > > I know the columns, but i may nee

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Dorian Hoxha
Was just curious about the overhead. I know the columns, but i may need to add other columns in the future. Yeah, json is the alternative if this doesn't work. On Sun, Apr 20, 2014 at 7:54 PM, Fede Martinez wrote: > If you don't know the columns your type will have, you could consider > using

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Fede Martinez
If you don't know the columns your type will have, you could consider using json or hstore if the data is unstructured. El 20/04/2014 14:04, "Dorian Hoxha" escribió: > Hi list, > > I have a > create type thetype(width integer, height integer); > create table mytable(thetype thetype[]); > > How ca

[GENERAL] Re: Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread David G Johnston
Dorian Hoxha wrote > Hi list, > > I have a > create type thetype(width integer, height integer); > create table mytable(thetype thetype[]); > > How can i make an insert statement so if i later add fields to the > composite type, the code/query doesn't break ? > Maybe by specifying the fields of t

[GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Dorian Hoxha
Hi list, I have a create type thetype(width integer, height integer); create table mytable(thetype thetype[]); How can i make an insert statement so if i later add fields to the composite type, the code/query doesn't break ? Maybe by specifying the fields of the composite type in the query ? Thi

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Torsten Förtsch
On 20/04/14 12:08, Thomas Kellerer wrote: >> Example: >> >> btree (fmb_id, action_type) >> btree (fmb_id) >> [...] > > Btw: in the above example the second one is definitely not needed. > Any query that uses the second one (single column) can also use the > first one. I know. But the s

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Thomas Kellerer
Torsten Förtsch wrote on 20.04.2014 10:09: The problem is I have a number of indexes in a large system that are very similar. And I suspect some of them are superfluous. Example: btree (fmb_id, action_type) btree (fmb_id) Action_type in this case is one out of a handful of values (sh

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Gavin Flower
On 20/04/14 20:09, Torsten Förtsch wrote: On 20/04/14 03:02, Sergey Konoplev wrote: Thanks for you reply. an index can be INVALID (pg_index.indisvalid=false). I want to temporarily disable an index so that it won't be used to access data but will still be updated. Can I simply set pg_index.i

Re: [GENERAL] Disable an index temporarily

2014-04-20 Thread Torsten Förtsch
On 20/04/14 03:02, Sergey Konoplev wrote: Thanks for you reply. >> an index can be INVALID (pg_index.indisvalid=false). >> >> I want to temporarily disable an index so that it won't be used to >> access data but will still be updated. >> >> Can I simply set pg_index.indisvalid=false and later tur