Re: pg_filedump for 9.4? - Mailing list pgsql-hackers

From Stepan Rutz
Subject Re: pg_filedump for 9.4?
Date
Msg-id 6E54DA49-76CE-4E97-8D83-FB246BF8811C@gmx.de
Whole thread Raw
In response to Re: pg_filedump for 9.4?  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
List pgsql-hackers
Hi community,
while I am currently investigating why a certain table with highly redundant and utterly verbose xml becomes worse storage wise when making the xml more compact. Since i am quite new to this, I believe its the lz compression in the text database. But thats irrelevant now, just mentioning because tools like pg_filedump allow people like me to help themselves and a basic understanding of things.

During checking I noticed pg_filedump (current from git.postgresql.org incl. the below mentioned commit) does not compile on Mac-OSX. Afaik it will not compile as soon as post.h comes into play and USE_REPL_SNPRINTF is defined. Then printf and sprintf (ouch particular but code path seems tolerable) in the source of pg_filedump become pg_printf and so on. These replacements are part of postgres and can’t be linked into the standalone pg_filedump. At least that is certainly not the intention.

Putting 

#undef sprintf
#undef print

after the includes in pg_filedump fixes the mac compile and imho all builds where the USE_REPL_SNPRINTF is defined as a side effect of include postgres.h effectively taking printf from me.

Not sure how to deal with this issue correctly so this is just for your consideration since the issue is a bit broader imho.

Regards,
Stepan

  
Am 31.08.2014 um 17:25 schrieb Fabrízio de Royes Mello <fabriziomello@gmail.com>:



Em domingo, 31 de agosto de 2014, Christoph Berg <cb@df7cb.de> escreveu:
Re: Fabrízio de Royes Mello 2014-06-25 <CAFcNs+oAb8h-0w2vLEWj6R-Gv=xizgdBya3K=SCd_9Tjyo=Zmw@mail.gmail.com>
> On Wed, Jun 25, 2014 at 3:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Would like that, but I'm not sure what pgindent will do with the //
> > comments.  It's been on my to-do list to switch all the comments to C89
> > style and then pgindent it, but I don't see myself getting to that in this
> > decade :-(
> >
>
> I changed all // comments to /* */ and run pgindent.

I've pushed these patches to the git repository, thanks.


Thanks!

Fabrízio de Royes Mello


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [BUGS] Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns
Next
From: Gavin Flower
Date:
Subject: Re: Built-in binning functions