Re: regarding bdr extension

2018-10-03 Thread Durgamahesh Manne
On Tue, Oct 2, 2018 at 7:22 PM Andreas Kretschmer wrote: > > > Am 02.10.2018 um 15:29 schrieb Adrian Klaver: > > > >> > >> does this pgdg repository useful for configuration of bdr v3 ? > > > > BDR is a third party extension from 2nd Quadrant, they would be the > > ones to ask about configuring.

DB size difference after restore

2018-10-03 Thread Sonam Sharma
I have restored the database from backup dump but the size of source and target databases are different. What can be the reason for this ? Regards, Sonam

Re: DB size difference after restore

2018-10-03 Thread Benjamin Scherrey
If you're talking about space on drive then you can expect the new one to be smaller generally as it has been straight efficient writes rather than a bunch of updates and deletes which create "holes" in the physical file space. It helps if you are more detailed as to what you've observed if you wa

Re: DB size difference after restore

2018-10-03 Thread Sonam Sharma
Hello Ben, When we do \l+ , it is different than source, when we load backup from target server Regards, Sonam On Wed, Oct 3, 2018 at 6:17 PM Benjamin Scherrey wrote: > If you're talking about space on drive then you can expect the new one to > be smaller generally as it has been straig

Re: DB size difference after restore

2018-10-03 Thread Fabio Pardi
Hi Sonam, it is common that after an export (pg_dump) and a consecutive import, the new database uses less space than the old one. Under some circumstances, indexes can become unbalancedor bloated, and tables bloated. And that uses more space than it should. for the sake of trying it out: If y

Re: DB size difference after restore

2018-10-03 Thread Sonam Sharma
On Wed, Oct 3, 2018 at 6:21 PM Sonam Sharma wrote: > Hello Ben, > > When we do \l+ , it is different than source, when we load backup from > target server. > Backup is taken using pg_dump and its loaded as psql db name > > Regards, > > Sonam > > > > > > > On Wed, Oct 3, 2018 at 6:17 PM Benj

Re: DB size difference after restore

2018-10-03 Thread Chris Travers
On Wed, Oct 3, 2018 at 2:59 PM Sonam Sharma wrote: > > > On Wed, Oct 3, 2018 at 6:21 PM Sonam Sharma wrote: > >> Hello Ben, >> >> When we do \l+ , it is different than source, when we load backup from >> target server. >> >Backup is taken using pg_dump and its loaded as psql db name > It'

GIN multi-column index

2018-10-03 Thread Floris Van Nee
Hi, I've been looking at using GIN indices in some of my tables and was wondering something about their behavior when using them as a multi-column index. Suppose we have a table 't' with column 'a' as int and column 'b' as int[]. Suppose we also have a query like: select * from t where a=1 and

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread David Gauthier
Thanks Adrian and Christopher ! So the transaction will be rolled back automatically if there's a problem. Got it ! Question: How do I detect when it is appropriate to raise notice so as to be able to see the error message? Or will that automatically be sent to stdout if an error occurs? Quest

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread David Gauthier
I found "no_data" here... https://www.postgresql.org/docs/10/static/errcodes-appendix.html update blah, blah... if(no_data) then raise exception "update failed to update anything"; end if Is that how you detect if nothing was updated and how to make sure the thing returns and rolls back ? On W

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread David G. Johnston
On Wed, Oct 3, 2018 at 9:25 AM, David Gauthier wrote: > Is that how you detect if nothing was updated > https://www.postgresql.org/docs/10/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS Given your concerns and examples you might also want to look into serializable isolation; it i

Re: How can I get and handle the status of sql statements that run in plpgsql ?

2018-10-03 Thread Pavel Stehule
Hi st 3. 10. 2018 v 18:26 odesílatel David Gauthier napsal: > I found "no_data" here... > https://www.postgresql.org/docs/10/static/errcodes-appendix.html > > update blah, blah... > if(no_data) then > raise exception "update failed to update anything"; > end if > UPDATE IF NOT FOUND THEN

Re: Postgres 11, partitioning with a custom hash function

2018-10-03 Thread Harry B
Hi, Since I didn't hear back on how to make partitioning work using a custom hash function, I ended up changing my app/client to use postgres' built-in hash method instead - I just needed them to match. https://github.com/harikb/pghash https://github.com/harikb/pghash/blob/master/lib/pghash/pghas

Re: Postgres 11, partitioning with a custom hash function

2018-10-03 Thread Harry B
Hi, I am still having trouble reconciling what happens under the HASH partitioning!. If I have text column forming the basis of PARTITIONED BY HASH, the HASH value used in the partitioning setup does not seem to match to `hashtext()` of that value CREATE TABLE loopy (k TEXT PRIMARY KEY, something

Re: Postgres 11, partitioning with a custom hash function

2018-10-03 Thread David Rowley
On 4 October 2018 at 16:22, Harry B wrote: > I am still having trouble reconciling what happens under the HASH > partitioning!. If I have text column forming the basis of PARTITIONED BY > HASH, the HASH value used in the partitioning setup does not seem to match > to `hashtext()` of that value It