Re: How do I 'include' a stored procedure in a SQL script file - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How do I 'include' a stored procedure in a SQL script file
Date
Msg-id 200901120619.59756.aklaver@comcast.net
Whole thread Raw
In response to Re: How do I 'include' a stored procedure in a SQL script file  (DonnaR <donna@therudds.co.uk>)
List pgsql-general
On Monday 12 January 2009 3:14:56 am DonnaR wrote:
> Currently I'm using PGAdmin to create everything, but I need to create a
> script file to create the schemas and the tables to ultimately run outside
> of PGAdmin. Since I have triggers, I need to 'load in' the (long)
> stored/triggered procedures during this process (ie 'call or 'include'
> another file with the stored procedure in it). It's this 'call' that I
> can't get to work. The \i <other_file> doesn't work (syntax error) within
> this main file. I just want to tell it to go and read in this other file.
> Note: I'm assuming the same file should run wthin PGAdmin and then outside
> it.
>

Have you tried:
psql -d some_db -U some_user -f trigger_func.sql

\i only works inside of psql.

--
Adrian Klaver
aklaver@comcast.net

pgsql-general by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: domain+enum
Next
From: Shane Ambler
Date:
Subject: Re: Data comparison SQL in PG 8.2.9