pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump and table exclusion: multiple patterns
4+ messages / 2 participants
[nested] [flat]

* pg_dump and table exclusion: multiple patterns
@ 2010-09-28 11:57  Marc Mamin <M.Mamin@intershop.de>
  0 siblings, 1 reply; 4+ messages in thread

From: Marc Mamin @ 2010-09-28 11:57 UTC (permalink / raw)
  To: pgsql-admin

  hello,

  

  I'm trying to export a schema with multiple table exclusions:

  

    pg_dump -i -v -nXXX -T
'*20((08[0-9]+)|(09[0-9]+)|(100[1-8][0-9]+)|(1009[0-1][0-9]+))' 

    

  unfortunately, the filter does not work as expected.(no table at all
are excluded)

  

  when I try the same pattern with psql dt\, I get the expected list of
tables to exclude...

  

  

  pg_dump --version

  pg_dump (PostgreSQL) 8.3.9

 

  

  

  I'd appreciate some help.

  

  best regards,

  

  Marc Mamin

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump and table exclusion: multiple patterns
@ 2010-09-28 12:56  Marc Mamin <M.Mamin@intershop.de>
  parent: Marc Mamin <M.Mamin@intershop.de>
  0 siblings, 2 replies; 4+ messages in thread

From: Marc Mamin @ 2010-09-28 12:56 UTC (permalink / raw)
  To: Marc Mamin <M.Mamin@intershop.de>; pgsql-admin


here is a strange behaviour:

I did first simplify my syntax with multiples -T flags:

    pg_dump -i -v -nXXX -T '*2008*' -T '*2009*' -T '*201001*' -T '*201002*' .....

still not working.

But if I prefix my pattern with the schema name, then I finally get the expected result:

    pg_dump -i -v -nXXX -T 'XXX.*2008*' -T ' XXX.*2009*' -T ' XXX.*201001*' -T XXX.'*201002*' .....


seems that the use of the -n flag requires to use these schema names within the patterns ...

best regards,

Marc Mamin





> -------------------------------

  hello,
  
  I'm trying to export a schema with multiple table exclusions:
  
    pg_dump -i -v -nXXX -T '*20((08[0-9]+)|(09[0-9]+)|(100[1-8][0-9]+)|(1009[0-1][0-9]+))' 
    
  unfortunately, the filter does not work as expected.(no table at all are excluded)
  
  when I try the same pattern with psql dt\, I get the expected list of tables to exclude...
  
  
  pg_dump --version
  pg_dump (PostgreSQL) 8.3.9

  
  
  I'd appreciate some help.
  
  best regards,
  
  Marc Mamin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump and table exclusion: multiple patterns
@ 2010-09-28 13:20  Vibhor Kumar <vibhor.aim@gmail.com>
  parent: Marc Mamin <M.Mamin@intershop.de>
  1 sibling, 0 replies; 4+ messages in thread

From: Vibhor Kumar @ 2010-09-28 13:20 UTC (permalink / raw)
  To: Marc Mamin <M.Mamin@intershop.de>; +Cc: pgsql-admin


On Sep 28, 2010, at 6:26 PM, Marc Mamin wrote:

> But if I prefix my pattern with the schema name, then I finally get the expected result:
> 
>    pg_dump -i -v -nXXX -T 'XXX.*2008*' -T ' XXX.*2009*' -T ' XXX.*201001*' -T XXX.'*201002*' .....
> 
> 
> seems that the use of the -n flag requires to use these schema names within the patterns ...

By default tablename without namespace get search in Public Schema.

Please try something like this 

pg_dump -i -v -n XXXX -T '*.2008*' ....

Thanks & Regards,
Vibhor Kumar (PCP & OCP)
ITIL V3 Cerftified.
Web:www.EnterpriseDB.com




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pg_dump and table exclusion: multiple patterns
@ 2010-09-28 13:35  Vibhor Kumar <vibhor.aim@gmail.com>
  parent: Marc Mamin <M.Mamin@intershop.de>
  1 sibling, 0 replies; 4+ messages in thread

From: Vibhor Kumar @ 2010-09-28 13:35 UTC (permalink / raw)
  To: Marc Mamin <M.Mamin@intershop.de>; +Cc: pgsql-admin


On Sep 28, 2010, at 6:26 PM, Marc Mamin wrote:

> But if I prefix my pattern with the schema name, then I finally get the expected result:
> 
>    pg_dump -i -v -nXXX -T 'XXX.*2008*' -T ' XXX.*2009*' -T ' XXX.*201001*' -T XXX.'*201002*' .....
> 
> 
> seems that the use of the -n flag requires to use these schema names within the patterns ...

By default tablename without namespace get search in Public Schema.

Please try something like this 

pg_dump -i -v -n XXXX -T '*.2008*' ....

Thanks & Regards,
Vibhor Kumar (PCP & OCP)
ITIL V3 Cerftified.
Web:www.EnterpriseDB.com




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2010-09-28 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-09-28 11:57 pg_dump and table exclusion: multiple patterns Marc Mamin <M.Mamin@intershop.de>
2010-09-28 12:56 ` Marc Mamin <M.Mamin@intershop.de>
2010-09-28 13:20   ` Vibhor Kumar <vibhor.aim@gmail.com>
2010-09-28 13:35   ` Vibhor Kumar <vibhor.aim@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox