Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread Edson Richter
Em 14/06/2016 01:33, David G. Johnston escreveu: On Monday, June 13, 2016, Edson Richter > wrote: Em 13/06/2016 23:36, Edson Richter escreveu: Em 13/06/2016 23:18, rob stone escreveu: On Mon, 2016-06-13 at 22:41 -0300,

Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread David G. Johnston
On Monday, June 13, 2016, Edson Richter wrote: > Em 13/06/2016 23:36, Edson Richter escreveu: > > Em 13/06/2016 23:18, rob stone escreveu: > > On Mon, 2016-06-13 at 22:41 -0300, Edson Richter wrote: > > Em 13/06/2016 22:33, Edson Richter escreveu: > > I've a table "A"

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread Patrick B
Yep... thanks Melvin.. It's working as expected now Cheers

Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread Edson Richter
Em 13/06/2016 23:36, Edson Richter escreveu: Em 13/06/2016 23:18, rob stone escreveu: On Mon, 2016-06-13 at 22:41 -0300, Edson Richter wrote: Em 13/06/2016 22:33, Edson Richter escreveu: I've a table "A" with 4,000,000 records. I've decided to delete records from oldest to newest but I can't

Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread Edson Richter
Em 13/06/2016 23:18, rob stone escreveu: On Mon, 2016-06-13 at 22:41 -0300, Edson Richter wrote: Em 13/06/2016 22:33, Edson Richter escreveu: I've a table "A" with 4,000,000 records. I've decided to delete records from oldest to newest but I can't delete records that have references in tables

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread Melvin Davidson
On Mon, Jun 13, 2016 at 10:07 PM, rob stone wrote: > On Tue, 2016-06-14 at 13:33 +1200, Patrick B wrote: > > > > > > 2016-06-14 9:47 GMT+12:00 Adrian Klaver : > > > On 06/13/2016 02:42 PM, Patrick B wrote: > > > > Hi guys, > > > > > > > > I

Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread rob stone
On Mon, 2016-06-13 at 22:41 -0300, Edson Richter wrote: > Em 13/06/2016 22:33, Edson Richter escreveu: > > I've a table "A" with 4,000,000 records. > > > > I've decided to delete records from oldest to newest but I can't  > > delete records that have references in tables "B", "C" or "D". > > > >

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread rob stone
On Tue, 2016-06-14 at 13:33 +1200, Patrick B wrote: > > > 2016-06-14 9:47 GMT+12:00 Adrian Klaver : > > On 06/13/2016 02:42 PM, Patrick B wrote: > > > Hi guys, > > > > > > I created this function: > > > > > >             CREATE or REPLACE FUNCTION function(account_id

Re: [GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread Edson Richter
Em 13/06/2016 22:33, Edson Richter escreveu: I've a table "A" with 4,000,000 records. I've decided to delete records from oldest to newest but I can't delete records that have references in tables "B", "C" or "D". so, I've with qry as ( select A.id from A where not

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread Patrick B
2016-06-14 9:47 GMT+12:00 Adrian Klaver : > On 06/13/2016 02:42 PM, Patrick B wrote: > >> Hi guys, >> >> I created this function: >> >> CREATE or REPLACE FUNCTION function(account_id integer) >> >> RETURNS void AS $$ >> >> begin >> >>

[GENERAL] Index seems "lost" after consecutive deletes

2016-06-13 Thread Edson Richter
I've a table "A" with 4,000,000 records. I've decided to delete records from oldest to newest but I can't delete records that have references in tables "B", "C" or "D". so, I've with qry as ( select A.id from A where not exists (select 1 from B where B.a_id = A.id)

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread Adrian Klaver
On 06/13/2016 02:42 PM, Patrick B wrote: Hi guys, I created this function: CREATE or REPLACE FUNCTION function(account_id integer) RETURNS void AS $$ begin execute 'COPY ( SELECT * FROM backup_table WHERE account_id =

Re: [GENERAL] Automate copy - Postgres 9.2

2016-06-13 Thread Patrick B
Hi guys, I created this function: CREATE or REPLACE FUNCTION function(account_id integer) RETURNS void AS $$ begin execute 'COPY ( SELECT * FROM backup_table WHERE account_id = ' || account_id || 'AND > status = 1 ) TO ''/var/lib/pgsql/'||account_id||'.sql'''; end $$ language 'plpgsql';

Re: [GENERAL] BDR

2016-06-13 Thread Alvaro Aguayo Garcia-Rada
Block based replication is the replication mechanism postgres incorporates natively. It's, in brief, sending all the file-level changes to all the slaves, so the data folder is always the same. It's like having a replicated folder, not including logs and some other things. The disadvantage of

Re: [GENERAL] BDR

2016-06-13 Thread Rakesh Kumar
http://bdr-project.org/docs/next/logical-vs-physical.html "It (BDR) has significant advantages - and some disadvantages - when compared to PostgreSQL's older physical (block-based) streaming or archive-based replication with warm or hot standby" What exactly is block based? Changes are recorded

Re: [GENERAL] table name size

2016-06-13 Thread David G. Johnston
On Mon, Jun 13, 2016 at 7:21 AM, Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi > > how to create table name with size, the limitation we are facing is 63 > length > > these are dynamic tables created from application > > issue is: > we cannot suggest/tell client to change

[GENERAL] table name size

2016-06-13 Thread Sridhar N Bamandlapally
Hi how to create table name with size, the limitation we are facing is 63 length these are dynamic tables created from application issue is: we cannot suggest/tell client to change NAMEDATALEN constant in src/include/pg_config_manual.h do we have any other option, please Thanks Sridhar