Skip site navigation (1) Skip section navigation (2)

Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 20:36:30
Message-ID: 4B43A2CE.7010209@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers

Tom Lane wrote:
> I'm not nearly good enough in Perl to be sure about the semantics
> of this loop.  Is it possible that it's changing the global contents
> of the @$data structure, rather than just hacking a local copy of
> each row before pushing some values into @fmgr?
>   

That's exactly what it does. The loop variable is an alias. See 
perlsyn(1) for details.

These two lines appear to be suspicious:

    $row->{bki_values} =~ s/"[^"]*"/"xxx"/g;
    @{$row}{(at)attnames} = split /\s+/, $row->{bki_values};

Something like:

    (my $bkival = $row->{bki_values}) =~ s/"[^"]*"/"xxx"/g;
    my $atts = {};
    @{$atts}{(at)attnames} = split /\s+/, $bkival;

might work better.

cheers

andrew


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-01-05 20:48:23
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Previous:From: Tom LaneDate: 2010-01-05 20:23:57
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial

pgsql-committers by date

Next:From: Tom LaneDate: 2010-01-05 20:48:23
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Previous:From: Tom LaneDate: 2010-01-05 20:23:57
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group