pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
plain text difference with pg_dump
3+ messages / 3 participants
[nested] [flat]

* plain text difference with pg_dump
@ 2009-03-26 14:53  Sabin Coanda <sabin.coanda@deuromedia.ro>
  0 siblings, 2 replies; 3+ messages in thread

From: Sabin Coanda @ 2009-03-26 14:53 UTC (permalink / raw)
  To: pgsql-admin

Hi there,

I have two databases DD and DP. DD is used for development, and DP in 
production.
After develop something on DD, a diff package is made and it upgrades DP. 
Normally after that DD has to be identically with DP.

The problem is when I check the structure difference between DD and DP. My 
procedure is to use pg_dump to make a plain text dump of the two databases, 
and compare them, ignoring the comments. All the procedures are sorted 
identically, excepting those with the same name, but different arguments.

Do you know a method to get the same text dump ?

TIA,
Sabin 





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

* Re: plain text difference with pg_dump
@ 2009-03-26 15:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Sabin Coanda <sabin.coanda@deuromedia.ro>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2009-03-26 15:43 UTC (permalink / raw)
  To: Sabin Coanda <sabin.coanda@deuromedia.ro>; +Cc: pgsql-admin

"Sabin Coanda" <sabin.coanda@deuromedia.ro> writes:
> The problem is when I check the structure difference between DD and DP. My 
> procedure is to use pg_dump to make a plain text dump of the two databases, 
> and compare them, ignoring the comments. All the procedures are sorted 
> identically, excepting those with the same name, but different arguments.

> Do you know a method to get the same text dump ?

Yeah, this has been complained about before.  The problem is that
pg_dump's DOTypeNameCompare() function sorts only by object name,
and if the names are the same then by object OID (which typically
boils down to being the creation order).  Ideally we should get it
to consider more data, such as the argument lists for similarly-named
functions, before falling back on OID order.

If you're not up to hacking a fix for that, you could try dropping
the functions and re-creating them in the same order on both machines,
so that the OID sort produces similar results.

			regards, tom lane



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

* Re: plain text difference with pg_dump
@ 2009-03-26 16:11  Marc Mamin <M.Mamin@intershop.de>
  parent: Sabin Coanda <sabin.coanda@deuromedia.ro>
  1 sibling, 0 replies; 3+ messages in thread

From: Marc Mamin @ 2009-03-26 16:11 UTC (permalink / raw)
  To: Sabin Coanda <sabin.coanda@deuromedia.ro>; pgsql-admin


Hello,


A long time ago I started to write a procedure to retrive a signature of
all objects of a given type for a similar purpose.
Depending on what kind of objects you want to check this may be a - very
ugly and complicate - solution.
In my case I was only interested in the object definition, not the data.


here my old code for the procs....

select 'pg_proc' ||'|'||
proowner ||'|'||
proname ||'|'||
prolang ||'|'||
case when proisagg =true then 'y' else 'n' end ||'|'||
case when prosecdef =true then 'y' else 'n' end ||'|'||
case when proisstrict =true then 'y' else 'n' end ||'|'||
case when proretset =true then 'y' else 'n' end ||'|'||
provolatile ||'|'||
pronargs ||'|'||
prorettype ||'|'||
to_querystring(proargtypes) ||'|'||
to_querystring(proargmodes) ||'|'||
to_querystring(proargnames) ||'|'
AS CHECKSTRING
from pg_proc    
order by CHECKSTRING

Marc Mamin










 

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Sabin Coanda
Sent: Thursday, March 26, 2009 3:54 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] plain text difference with pg_dump

Hi there,

I have two databases DD and DP. DD is used for development, and DP in
production.
After develop something on DD, a diff package is made and it upgrades
DP. 
Normally after that DD has to be identically with DP.

The problem is when I check the structure difference between DD and DP.
My procedure is to use pg_dump to make a plain text dump of the two
databases, and compare them, ignoring the comments. All the procedures
are sorted identically, excepting those with the same name, but
different arguments.

Do you know a method to get the same text dump ?

TIA,
Sabin 



--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



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


end of thread, other threads:[~2009-03-26 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-03-26 14:53 plain text difference with pg_dump Sabin Coanda <sabin.coanda@deuromedia.ro>
2009-03-26 15:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2009-03-26 16:11 ` Marc Mamin <M.Mamin@intershop.de>

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