Обсуждение: alter view foo set () -- fixed in 9.2 stable, but when will it be released?
I'm running into this bug fixed a few days after 9.2.1 was released: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d2292f6405670e1fdac13998f87b4348c71fb9e6
Anyone know when 9.2.2 will go out?
Thanks,
Joe
Re: alter view foo set () -- fixed in 9.2 stable, but when will it be released?
От
Chris Angelico
Дата:
On Sat, Nov 3, 2012 at 9:15 AM, Joe Van Dyk <joe@tanga.com> wrote: > I'm running into this bug fixed a few days after 9.2.1 was released: > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d2292f6405670e1fdac13998f87b4348c71fb9e6 > > Anyone know when 9.2.2 will go out? Point of random curiosity: The commit mentioned adds the following line: if (rinfo->reloptions && strlen(rinfo->reloptions) > 0) Is there a reason this isn't done as: if (rinfo->reloptions && *rinfo->reloptions) ? It seems like overkill to ascertain the string length just to find out if the first character is the null terminator. ChrisA
Re: alter view foo set () -- fixed in 9.2 stable, but when will it be released?
От
Ondrej Ivanič
Дата:
Hi, On 5 November 2012 08:39, Chris Angelico <rosuav@gmail.com> wrote: > On Sat, Nov 3, 2012 at 9:15 AM, Joe Van Dyk <joe@tanga.com> wrote: > Point of random curiosity: The commit mentioned adds the following line: > > if (rinfo->reloptions && strlen(rinfo->reloptions) > 0) > > Is there a reason this isn't done as: > > if (rinfo->reloptions && *rinfo->reloptions) > > ? It seems like overkill to ascertain the string length just to find > out if the first character is the null terminator. My guess is to be multibyte encoding safe: UTF-16 or similar. -- Ondrej Ivanic (ondrej.ivanic@gmail.com)
Re: alter view foo set () -- fixed in 9.2 stable, but when will it be released?
От
Chris Angelico
Дата:
On Mon, Nov 5, 2012 at 8:48 AM, Ondrej Ivanič <ondrej.ivanic@gmail.com> wrote: > On 5 November 2012 08:39, Chris Angelico <rosuav@gmail.com> wrote: >> Point of random curiosity: The commit mentioned adds the following line: >> >> if (rinfo->reloptions && strlen(rinfo->reloptions) > 0) >> >> Is there a reason this isn't done as: >> >> if (rinfo->reloptions && *rinfo->reloptions) >> >> ? It seems like overkill to ascertain the string length just to find >> out if the first character is the null terminator. > > My guess is to be multibyte encoding safe: UTF-16 or similar. Oh, is your strlen function not the default C strlen, then? I'd best not look at out-of-context patches then, heh :) ChrisA
Chris Angelico <rosuav@gmail.com> writes: > Point of random curiosity: The commit mentioned adds the following line: > if (rinfo->reloptions && strlen(rinfo->reloptions) > 0) > Is there a reason this isn't done as: > if (rinfo->reloptions && *rinfo->reloptions) Just that the former is the general coding style in pg_dump, not the latter. pg_dump typically isn't working with long strings in these places, so I'd be pretty surprised if this was a worthwhile optimization. But if we were going to do it we should do it throughout pg_dump, not just here. regards, tom lane