Re: [GENERAL] Feature request: separate logging

2016-11-19 Thread Guillaume Lelarge
Le 18 nov. 2016 2:03 PM, "otheus uibk" a écrit : > > A glaring weakness in Postgresql for production systems is that the administrator has no way of controlling what types of logs go where. There are at least two types of logs: errors and statement logs. (I could also add: connection, syntax error

Re: [GENERAL] pgbench and scaling

2016-11-19 Thread rakeshkumar464
"Are the TPS numbers per pgbench? If so, then you're getting 10x490=4900 TPS system wide, or 20*280=5600 TPS system wide. " Per pgbench. Your explanation makes sense. thanks. -- View this message in context: http://postgresql.nabble.com/pgbench-and-scaling-tp5930891p5931131.html Sent from

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Adrian Klaver
On 11/19/2016 11:12 AM, Fran ... wrote: > Hi, > > > You were right and I have tried to grant that role to user and I get > following errors.. > > > /pg_restore: [archiver (db)] Error while PROCESSING TOC:/ > /pg_restore: [archiver (db)] Error from TOC entry 4335; 2606 151422 FK > CONSTRAINT wor

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Adrian Klaver
On 11/19/2016 11:12 AM, Fran ... wrote: > Hi, > > > You were right and I have tried to grant that role to user and I get > following errors.. GRANT what role to what user? > > > /pg_restore: [archiver (db)] Error while PROCESSING TOC:/ > /pg_restore: [archiver (db)] Error from TOC entry 4335;

[GENERAL] Strict min and max aggregate functions

2016-11-19 Thread Jeff Janes
I need "strict" MIN and MAX aggregate functions, meaning they return NULL upon any NULL input, and behave like the built-in aggregates if none of the input values are NULL. This doesn't seem like an outlandish thing to want, and I'm surprised I can't find other discussion of it. Perhaps because n

Re: [GENERAL] Partial update on an postgres upsert violates constraint

2016-11-19 Thread Tom Lane
Adrian Klaver writes: > ... So looks like constraints are checked before you get to the ON CONFLICT > section. Right. ON CONFLICT is a means for dealing with duplicate-key errors in the specified (or inferred) unique index. It is *not* an all-purpose error catcher. In the case at hand, the gi

Re: [GENERAL] Partial update on an postgres upsert violates constraint

2016-11-19 Thread Adrian Klaver
On 11/19/2016 11:33 AM, Kim Rose Carlsen wrote: >> AFAIK, EXCLUDED is only available in a trigger function: > >> >> https://www.postgresql.org/docs/9.5/static/trigger-definition.html >> >> You are using EXCLUDED in a regular function so it would not be found. >> >> Can you also show the failure f

Re: [GENERAL] Partial update on an postgres upsert violates constraint

2016-11-19 Thread Kim Rose Carlsen
> AFAIK, EXCLUDED is only available in a trigger function: > > https://www.postgresql.org/docs/9.5/static/trigger-definition.html > > You are using EXCLUDED in a regular function so it would not be found. > > Can you also show the failure for your alternate method? >From the manual https://www.po

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Fran ...
Hi, You were right and I have tried to grant that role to user and I get following errors.. pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 4335; 2606 151422 FK CONSTRAINT worker_id_refs_id_6fd8ce95 owneruser pg_restore: [archiver (db)]

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Adrian Klaver
On 11/19/2016 09:33 AM, Fran ... wrote: Hi, I run "pg_dumpall" command and there are the permissions por the user: /CREATE ROLE dlapuser;/ /ALTER ROLE dlapuser WITH *SUPERUSER* INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION PASSWORD 'md5XXafac';/ I think I would solv

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Tom Lane
"Fran ..." writes: > I think I would solve the problem granting "superuser" permission but this is > not possible in RDS. It looks like your other errors are also due to doing the restore as a non-superuser. Not sure if you have any good alternatives here --- you could just ignore the errors re

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Fran ...
Hi, I run "pg_dumpall" command and there are the permissions por the user: CREATE ROLE dlapuser; ALTER ROLE dlapuser WITH SUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION PASSWORD 'md5XXafac'; I think I would solve the problem granting "superuser" permission b

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Adrian Klaver
On 11/19/2016 07:21 AM, Fran ... wrote: Hi Adrian, these are some of them: /pg_restore: [archiver (db)] Error from TOC entry 4997; 0 0 SEQUENCE SET account_id_seq owneruser/ /pg_restore: [archiver (db)] could not execute query: ERROR: permission denied for sequence account_id_seq/ /Comma

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Tom Lane
"Fran ..." writes: > these are some of them: These look to be cascading damage from some earlier failure. I'd advise looking at the first one or two errors and solving them, then repeat as necessary. In general, though, pg_dump of a single database is not a complete representation of where you

Re: [GENERAL] [HACKERS] How to change order sort of table in HashJoin

2016-11-19 Thread Tom Lane
Man Trieu writes: > As in the example below, i think the plan which hash table is created on > testtbl2 (the fewer tuples) should be choosen. The planner usually prefers to hash on the table that has a flatter MCV histogram, since a hash table with many key collisions will be inefficient. You mi

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Fran ...
Hi Adrian, these are some of them: pg_restore: [archiver (db)] Error from TOC entry 4997; 0 0 SEQUENCE SET account_id_seq owneruser pg_restore: [archiver (db)] could not execute query: ERROR: permission denied for sequence account_id_seq Command was: SELECT pg_catalog.setval('account_id_

Re: [GENERAL] Partial update on an postgres upsert violates constraint

2016-11-19 Thread Adrian Klaver
On 11/17/2016 10:13 PM, Andreas Terrius wrote: Hi, Basically I wanted to do a partial update inside pg (9.5), but it seems that a partial update fails when not all of constraint is fulfilled (such as the not null constraint) Below are the sql queries I used, |CREATETABLEjobs (id integer PRIMARY

Re: [GENERAL] How to change order sort of table in HashJoin

2016-11-19 Thread Melvin Davidson
On Sat, Nov 19, 2016 at 12:46 AM, Man Trieu wrote: > Hi Experts, > > As in the example below, i think the plan which hash table is created on > testtbl2 (the fewer tuples) should be choosen. > Because creating of hash table should faster in testtbl2. But it did not. > > I have tried to change the

Re: [GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Adrian Klaver
On 11/19/2016 05:21 AM, Fran ... wrote: Hi, I have to migrate a production database to RDS. This is the size and info: database | owneruser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/owneruser+| 32 GB | pg_default | Origin database: 1 database 1 owneruser with superu

[GENERAL] Database migration to RDS issues permissions

2016-11-19 Thread Fran ...
Hi, I have to migrate a production database to RDS. This is the size and info: database | owneruser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/owneruser+| 32 GB | pg_default | Origin database: 1 database 1 owneruser with superuser permission Backup archived size is