Re: [pgsql-hackers-win32] snprintf causes regression tests

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nicolai Tufar <ntufar(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <mha(at)sollentuna(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Date: 2005-03-14 18:55:16
Message-ID: 200503141855.j2EItGp11936@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Nicolai Tufar wrote:
> On Thu, 10 Mar 2005 19:21:41 -0500 (EST), Bruce Momjian
> <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> > > The CVS-tip implementation is fundamentally broken and won't work even
> > > for our internal uses. I've not wasted time complaining about it
> > > because I thought we were going to replace it. If we can't find a
> > > usable replacement then we're going to have to put a lot of effort
> > > into fixing what's there. On the whole I think the effort would be
> > > better spent importing someone else's solution.
> >
> > Oh, so our existing implementation doesn't even meet our needs. OK.

(Your new patch is in the queue.)

I have been thinking about our current snprintf() implementation. As I
remember, we use snprintf mostly for an snprintf that doesn't support
long long, and now those that don't support %$. I am wondering if we
should just process long long args and %$ args, and pass everything else
to the native snprintf.

In fact, one trick would be to substitute long long and %$ in the printf
format string, and then pass that to the native libc printf, with
adjustments for the printf format arguments. That might be simpler than
emulating all of snprintf.

FYI, now that we are using pg_snprintf macros the native snprintf is
available to us.

Anyway, I am sure there are some platforms that don't have vsnprint or
snprintf, but could we just say we don't support them, or emulate one of
we only have the other?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Miroslav Šulc 2005-03-14 19:11:43 Re: Avoiding tuple construction/deconstruction during joining
Previous Message Greg Stark 2005-03-14 17:38:17 Re: invalidating cached plans

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Tom Lane 2005-03-14 19:19:14 Re: [pgsql-hackers-win32] snprintf causes regression tests to fail
Previous Message Nicolai Tufar 2005-03-12 15:00:14 Re: [pgsql-hackers-win32] snprintf causes regression tests to fail

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-03-14 19:19:14 Re: [pgsql-hackers-win32] snprintf causes regression tests to fail
Previous Message Bruce Momjian 2005-03-14 18:28:43 Re: submitted WIN1252 patches are buggy