Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id DD561477561; Fri, 28 Jun 2002 16:51:03 -0400 (EDT) Mailbox-Line: From jie@stbernard.com Fri Jun 28 16:51:03 2002 Received: from MAIL01.stbernard.com (mail01.stbernard.com [64.154.93.162]) by postgresql.org (Postfix) with ESMTP id 373E9475A67; Fri, 28 Jun 2002 16:46:09 -0400 (EDT) Received: by MAIL01.stbernard.com with Internet Mail Service (5.5.2653.19) id ; Fri, 28 Jun 2002 13:46:10 -0700 Message-ID: <7C760DAA511DC74B99E7D22189F786F101BF2105@MAIL01.stbernard.com> From: Jie Liang To: 'Jan Wieck' Cc: 'Bruce Momjian' , "'admin@postgresql.org'" , "'pgsql-sql@postgresql.org'" Subject: Re: pg_restore cannot restore function Date: Fri, 28 Jun 2002 13:46:09 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, hits=0.0 required=5.0 tests=none version=2.30 X-Spam-Level: X-Archive-Number: 200206/405 X-Sequence-Number: 8370 No any error msg in the logfile, I didn't see any create function statement in my logfile which I enabled the query log. This function is written in PL/pgSQL which is enabled in target db, If I pg_dump the schema into a plain text file, I can see its defination there, I can easily copy & paste (restore) it into mydb2. however, I failed to restore it by using flag -P with compressed file. I also tried to use su postgres -c "/usr/local/pgsql/bin/pg_restore --function=myfunction --dbname=mydb2 dbf" error msg pg_restore: [archiver] could not open input file: No such file or directory weird??? I use pg_restore -Rxt mytable -d mydb2 dbf have no such a problem, it works. Is any syntax error?? I am confused by documentation now! Is it a bug???? Thanks Jie Liang -----Original Message----- From: Jan Wieck [mailto:JanWieck@Yahoo.com] Sent: Friday, June 28, 2002 12:39 PM To: Jie Liang Cc: 'Bruce Momjian'; 'admin@postgresql.org'; 'pgsql-sql@postgresql.org' Subject: Re: [SQL] pg_restore cannot restore function Jie Liang wrote: > > I use > pg_dump -Fc mydb > dbf > then I create another db by: > createdb mydb2 > I use > pg_restore -P myfunction -d mydb2 dbf > > cannot restore myfunction into mydb2 > > why?????? Good question. Is there any error message in the postmaster log? If the function is written in a procedural language, is that language enabled in the target database? If the function is written in the SQL language, do all underlying objects like tables and views exist? If it's a C language function, does the shared object containing the function exist at the expected location? Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #