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

BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory

From: "Timur Luchkin" <timur(dot)luchkin(at)ctxm(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory
Date: 2007-10-12 13:01:07
Message-ID: 200710121301.l9CD17ab098721@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      3673
Logged by:          Timur Luchkin
Email address:      timur(dot)luchkin(at)ctxm(dot)com
PostgreSQL version: 8.2.5
Operating system:   Fedora Core 5 / Red Hat Ent. Linux AS 3
Description:        Untrusted perl language: ERROR: could not open relation
1663/16384/1259: No such file or directory
Details: 

I have stored procedure in "plperlu" language. After the call to it Im
getting "could not open relation ... No such file or directory" on any next
operation in psql (the procedure itself works fine). If I'll close the
console and reopen it again, then everything works fine again (until the
next call to it).

Perl's SP code:

CREATE OR REPLACE FUNCTION fnc_prepare_base_dir (base_path IN  TEXT)
RETURNS INTEGER AS
$$
   my $base_path = $_[0];
   my $status = 0;

   if (-d "$base_path") {
      chdir("$base_path");
      @files = <*.cpio>;
      foreach $file (sort @files) {
         if (-f "$base_path/$file") {
            $status = system("cd $base_path > /dev/null; cpio --quiet -idmv
--no-absolute-filenames < $file > /dev/null; rm -f $file > /dev/null");
            if ($status > 0) {
               return $status;
            }
        }
      }
      return 0;
   }
   else {
      return 5;
   }
$$
LANGUAGE plperlu;


To repeat this do the next:

$psql -U tham
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

mydb=# SELECT * FROM fnc_prepare_base_dir
('/export/storage3/postgres/etl_data');
 fnc_prepare_base_dir
----------------------
                    0
(1 row)

mydb=# \dt
ERROR:  could not open relation 1663/16384/1259: No such file or directory
mydb=# \q

$ psql -U tham
Welcome to psql 8.2.5, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

mydb=# \dt
       List of relations
 Schema | Name  | Type  | Owner
--------+-------+-------+-------
 public | cust1 | table | tham
 public | abc2  | table | tham
(2 rows)

mydb=#

Responses

pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2007-10-12 13:34:59
Subject: Re: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory
Previous:From: Marc MaminDate: 2007-10-12 12:50:55
Subject: BUG #3672: ALTER <column> TYPE change the underlying index tablespace to default

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