X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 803ED9DC84A for ; Mon, 16 Jan 2006 23:10:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 10706-01 for ; Mon, 16 Jan 2006 23:10:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by postgresql.org (Postfix) with ESMTP id C67E39DC829 for ; Mon, 16 Jan 2006 23:10:33 -0400 (AST) Received: from lythanhphu ([66.130.233.129]) by VL-MO-MR003.ip.videotron.ca (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTP id <0IT70020UVHQZ391@VL-MO-MR003.ip.videotron.ca> for pgsql-sql@postgresql.org; Mon, 16 Jan 2006 22:10:38 -0500 (EST) Date: Mon, 16 Jan 2006 22:10:34 -0500 From: Daniel CAUNE Subject: Re: Executing plpgsql scripts using psql, is that possible? In-reply-to: <200601161835.48794.aklaver@comcast.net> To: aklaver@comcast.net, pgsql-sql@postgresql.org Message-id: <0IT70020VVHQZ391@VL-MO-MR003.ip.videotron.ca> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7BIT Thread-index: AcYbDru/Ug2/akUaSgufaXGIY/Ep6gABLjbA X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.621 required=5 tests=[AWL=0.621] X-Spam-Score: 0.621 X-Spam-Level: X-Archive-Number: 200601/103 X-Sequence-Number: 23892 > If you want to use plpgsql it will need to be within a function. In your > reply > you mention creating user-defined functions as part of the set up > procedure. > It would not be weird to include the static data function as part of that > procedure and then call it to load the data. I see no reason to destroy > the > function after use. If that is not the route you want to take you may want > to > look at the following for information on using COPY to load data from a > file > into a table- > www.postgresql.org/docs/8.1/interactive/sql-copy.html > Yes, COPY may be an interesting option too. Thanks!