fmtId() and pg_dump

Started by Neil Conwayabout 24 years ago4 messagespatches
Jump to latest
#1Neil Conway
neilc@samurai.com

The attached patch implements the scheme outlined on -hackers a little
while ago for reducing the usage of fmtId() in pg_dump. This is just
a "proof of concept" -- I added a simple wrapper over
appendPQExpBuffer() that takes an extra formatting sequence. The
implementation is pretty trivial -- the assumption is made that

(a) all printf-like formatting sequences consist of a '%' followed
by a single character

(b) any occurance of a '%' is a part of a formatting string

I've converted a few of the places where fmtId() is used over to the new
syntax. The reason I'm posting the patch is to get some feedback:
is this a better method can just calling fmtId()?

If so, I'll add some comments, convert all the code to use the wrapper
as necessary, and think up a better name for the wrapper function.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachments:

pg_dump_fmtid-4.patchtext/plain; charset=us-asciiDownload+74-45
#2Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#1)
Re: fmtId() and pg_dump

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------

Neil Conway wrote:

The attached patch implements the scheme outlined on -hackers a little
while ago for reducing the usage of fmtId() in pg_dump. This is just
a "proof of concept" -- I added a simple wrapper over
appendPQExpBuffer() that takes an extra formatting sequence. The
implementation is pretty trivial -- the assumption is made that

(a) all printf-like formatting sequences consist of a '%' followed
by a single character

(b) any occurance of a '%' is a part of a formatting string

I've converted a few of the places where fmtId() is used over to the new
syntax. The reason I'm posting the patch is to get some feedback:
is this a better method can just calling fmtId()?

If so, I'll add some comments, convert all the code to use the wrapper
as necessary, and think up a better name for the wrapper function.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: fmtId() and pg_dump

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Your patch has been added to the PostgreSQL unapplied patches list at:

I do not believe Neil intended this patch to be applied.

The attached patch implements the scheme outlined on -hackers a little
while ago for reducing the usage of fmtId() in pg_dump. This is just
a "proof of concept"

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: fmtId() and pg_dump

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Your patch has been added to the PostgreSQL unapplied patches list at:

I do not believe Neil intended this patch to be applied.

The attached patch implements the scheme outlined on -hackers a little
while ago for reducing the usage of fmtId() in pg_dump. This is just
a "proof of concept"

Yes, sorry. I knew someone liked the fmtId patch and I thought it was
this one. I guess they just liked the _idea_ and a patch wasn't
supplied.

Patch removed.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026