Re: [GENERAL] What limits Postgres performance when the whole database lives in cache?

2016-09-10 Thread Pavel Stehule
2016-09-11 7:20 GMT+02:00 dandl : > > From: Jim Nasby [mailto:jim.na...@bluetreble.com] > > My guess is this is a test scenario that completely favors VoltDB > > while hamstringing Postgres, such as using no transaction durability > > at all in VoltDB while using maximum

Re: [GENERAL] What limits Postgres performance when the whole database lives in cache?

2016-09-10 Thread dandl
> From: Jim Nasby [mailto:jim.na...@bluetreble.com] > My guess is this is a test scenario that completely favors VoltDB > while hamstringing Postgres, such as using no transaction durability > at all in VoltDB while using maximum durability in Postgres. Comparing > the cost of every COMMIT doing

Re: [GENERAL] Duplicate data despite unique constraint

2016-09-10 Thread Daniel Caldeweyher
I had a similar issue once and was able to recover from it. If this affects only some rows and you are able to identify them, this is fixable: --force table scan to skip using corrupt index set enable_seqscan=1 set enable_indexscan=0 set enable_bitmapscan=0 select email,count(*) from users group

Re: [GENERAL] Duplicate data despite unique constraint

2016-09-10 Thread Jim Nasby
On 9/2/16 8:02 AM, Adrian Klaver wrote: Best guess is the INDEX on the column is corrupted and needs to be reindexed: You should contact AWS support about this; they'd want to know. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and

Re: [GENERAL] What limits Postgres performance when the whole database lives in cache?

2016-09-10 Thread Jim Nasby
On 9/8/16 3:15 AM, Nicolas Grilly wrote: So my question is not to challenge the Postgres way. It's simply to ask whether there are any known figures that would directly support or refute his claims. Does Postgres really spend 96% of its time in thumb-twiddling once the entire

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Jim Nasby
On 9/10/16 6:03 AM, Kiran wrote: If I insert a record from my application using following code : db.myschema.cf_question.insert({ cf_question_type_id:request.payload.type_id, cf_question_category_id:request.payload.cat_id, lang:request.payload.lang, body:request.payload.body } The above app code

Re: [GENERAL] 2.5TB Migration from SATA to SSD disks - PostgreSQL 9.2

2016-09-10 Thread Jim Nasby
On 9/8/16 3:29 PM, David Gibbons wrote: Isn't this heading in the wrong direction? We need to be more precise than 0 (since 0 is computed off of rounded/truncated time stamps), not less precise than 0. Cheers, Jeff Hmm, You may be right, reading it 4 more times for

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Dear Tom, Adrian, Excellent catch! Thank you very very much to both. It is resolved now. I can sleep now. Good night from Sweden. regards Kiran On Sat, Sep 10, 2016 at 11:18 PM, Adrian Klaver wrote: > On 09/10/2016 02:09 PM, Kiran wrote: > >> Hi Adrian, >> >> The

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Adrian Klaver
On 09/10/2016 02:09 PM, Kiran wrote: Hi Adrian, The JSON value is inserted into a column in the database which I can see. But the trigger which has to convert this JSON value in not tsvector column is not updating that column. As Tom explained, in your trigger function you have:

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi Adrian, The JSON value is inserted into a column in the database which I can see. But the trigger which has to convert this JSON value in not tsvector column is not updating that column. regards On Sat, Sep 10, 2016 at 10:27 PM, Tom Lane wrote: > Kiran

Re: [GENERAL] Question about locking and pg_locks

2016-09-10 Thread Jeff Janes
On Thu, Sep 8, 2016 at 4:30 AM, Moreno Andreo wrote: > Hi folks! :-) > > This morning I was woken up by a call of a coworker screaming "Help, our > Postgres server is throwing strange errors!" > Not the best way to start your day... > > OK, to the serious part. > >

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Adrian Klaver
On 09/10/2016 02:02 PM, Kiran wrote: Hi Tom, I have checked and the trigger is not disabled. and \drds results Role=blank database = mydatabase settings = default_text_search_config=pg_catalog.swedish Any other tips or suggestions please. Did you see this post?:

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi Tom, I have checked and the trigger is not disabled. and \drds results Role=blank database = mydatabase settings = default_text_search_config=pg_catalog.swedish Any other tips or suggestions please. regards Kiran On Sat, Sep 10, 2016 at 9:26 PM, Tom Lane wrote: >

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Tom Lane
Kiran writes: > LOG: execute : INSERT INTO "myschema"."cf_question" > ("cf_question_type_id", "cf_question_category_id", "lang", "body") VALUES > ($1, $2, $3, $4) RETURNING * > DETAIL: parameters: $1 = '1', $2 = '9', $3 = 'swedish', $4 = '{"name": "Do > you like Pizza

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi Adrian, This is the exact log in the file as it appears: DETAIL: parameters: $1 = '', $2 = '' LOG: connection received: host=localhost port=53284 LOG: connection authorized: user=deva database=mydatabase LOG: connection received: host=localhost port=53285 LOG: connection authorized:

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Tom Lane
Kiran writes: > But I do not know how to check whether the application is subject to > different ALTER USER SET parameters. psql's \drds ("display role/database SETs") would help. BTW, have you checked that the trigger is not disabled, and that there isn't

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Adrian Klaver
On 09/10/2016 11:39 AM, Kiran wrote: Hi Adrian, Thanks for your response. I tried with logging. The application is inserting the record that I am passing into the database. But the trigger is not firing. What is the text of the complete statement as it appears in the logs? When you do the

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Dear Tom, Thanks for your detailed reply. (1) Application is connecting to the same database. (2) Application is inserting to the same table without much luck with the trigger. (3) Application is issuing the right insert command. (4) I am not able to check this, is there any way I can check

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi Adrian, Thanks for your response. I tried with logging. The application is inserting the record that I am passing into the database. But the trigger is not firing. I have been looking into this issue since morning with out any positive outcome :(. If you have any other tips, it will be really

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Tom Lane
Adrian Klaver writes: > On 09/10/2016 03:59 AM, Kiran wrote: >> What could be the problem ? Why trigger is not working if I insert from the >> application ? Am I doing anything wrong ? > If you have not, turn on log_statement: >

Re: [GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Adrian Klaver
On 09/10/2016 03:59 AM, Kiran wrote: Hi, *Problem background :* I have a *function in the DB* as follows CREATE FUNCTION question_tsv_trigger() RETURNS trigger AS $BODY$ begin New.weighted_tsv := to_tsvector('swedish',coalesce(New.body->>'qtext','')::text); RAISE NOTICE 'TRIGER called on %',

Re: [GENERAL] Comibining UPDATE ... SET ... FROM (SELECT ...) with a JOIN

2016-09-10 Thread Alexander Farber
Thank you Brian and others, but - On Fri, Sep 9, 2016 at 5:22 PM, Brian Dunavant wrote: > I'm making the assumption that you only have one ip/user in words_users. > > with lockrow as ( >SELECT g.gid, u.ip >FROM words_games g join words_users u > ON (g.player1

[GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi, *Problem background :* I have a *function in the DB* as follows CREATE FUNCTION question_tsv_trigger() RETURNS trigger AS $BODY$ begin New.weighted_tsv := to_tsvector('swedish',coalesce(New.body->>'qtext','')::text); RAISE NOTICE 'TRIGER called on %', TG_TABLE_NAME; return New; end $BODY$

[GENERAL] Trigger is not working for Inserts from the application

2016-09-10 Thread Kiran
Hi, *Problem background :* I have a *function in the DB* as follows CREATE FUNCTION question_tsv_trigger() RETURNS trigger AS $BODY$ begin New.weighted_tsv := to_tsvector('swedish',coalesce(New.body->>'qtext','')::text); RAISE NOTICE 'TRIGER called on %', TG_TABLE_NAME; return New; end $BODY$