From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: RfD: more powerful "any" types |
Date: | 2009-09-09 19:48:45 |
Message-ID: | 20090909194845.GU4132@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Pavel Stehule escribió:
> 2009/9/9 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> > I already published a pseudo-sprintf function in the wiki here:
> > http://wiki.postgresql.org/wiki/Sprintf I'm looking for something
> > better, not just the same hacks.
> >
> > I don't see any good reason that the function needs to be far from core.
>
> what is use case? Why you need sprintf function, when you have ||
> operator. This functionality is redundant and out of standard. What I
> know, only MySQL has similar function.
Extensive use of || turns into horrible messes quickly. sprintf() makes
this kind of thing much cleaner. You could use strcat/strcpy in C too,
but do you? You could argue that sprintf is redundant in C, yet it
turns out to be extremely useful.
One use case is using it for error messages in RAISE/USING. Yes, I am
aware you can use concatenation there.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2009-09-09 19:57:15 | Re: RfD: more powerful "any" types |
Previous Message | Pavel Stehule | 2009-09-09 19:44:45 | Re: RfD: more powerful "any" types |