On Thu, Mar 9, 2017 at 3:20 PM, Robert Haas <robertmh...@gmail.com> wrote:

> On Mon, Mar 6, 2017 at 11:37 AM, Dagfinn Ilmari Mannsåker
> <ilm...@ilmari.org> wrote:
> > David Christensen <da...@endpoint.com> writes:
> >>> Hi David,
> >>>
> >>> Here's a review of your patch.
> >>
> >> Hi Ilmari, thanks for your time and review.  I’m fine with the revised
> version.
> >
> > Okay, I've marked the patch as Ready For Committer.
>
> Committed.   Hopefully this doesn't contain any Perl bits that are
> sufficiently new as to cause problems for our older BF members ... I
> guess we'll see.
>


Bad luck there.  I'm getting this error on CentOS6.8, perl v5.10.1

Can't locate object method "input_line_number" via package "IO::Handle" at
../../../src/backend/catalog/Catalog.pm line 82, <INPUT_FILE> line 148.
make[3]: *** [fmgrtab.c] Error 25
make[2]: *** [utils/fmgroids.h] Error 2
make[2]: *** Waiting for unfinished jobs....
Can't locate object method "input_line_number" via package "IO::Handle" at
../../../src/backend/catalog/Catalog.pm line 82, <INPUT_FILE> line 148.
make[3]: *** [postgres.bki] Error 25
make[2]: *** [submake-schemapg] Error 2
make[1]: *** [all-backend-recurse] Error 2
make: *** [all-src-recurse] Error 2


I think we can just save $. and use that, as in the attached.


I as sabotaged a random line in src/include/catalog/pg_amop.h and it seems
to report the error correctly.

Cheers,

Jeff
diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm
new file mode 100644
index 767a2ec..cb5fcc8
*** a/src/backend/catalog/Catalog.pm
--- b/src/backend/catalog/Catalog.pm
*************** sub Catalogs
*** 65,70 ****
--- 65,71 ----
                                $_ .= $next_line;
                                redo;
                        }
+                       my $input_line_number=$.;
  
                        # Strip useless whitespace and trailing semicolons.
                        chomp;
*************** sub Catalogs
*** 80,86 ****
                        elsif 
(/^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/)
                        {
                                check_natts($filename, $catalog{natts}, $3,
!                                                       $input_file, 
INPUT_FILE->input_line_number);
  
                                push @{ $catalog{data} }, { oid => $2, 
bki_values => $3 };
                        }
--- 81,87 ----
                        elsif 
(/^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/)
                        {
                                check_natts($filename, $catalog{natts}, $3,
!                                                       $input_file, 
$input_line_number);
  
                                push @{ $catalog{data} }, { oid => $2, 
bki_values => $3 };
                        }
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to