Re: How do I 'include' a stored procedure in a SQL script file

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: DonnaR <donna(at)therudds(dot)co(dot)uk>
Subject: Re: How do I 'include' a stored procedure in a SQL script file
Date: 2009-01-12 14:19:59
Message-ID: 200901120619.59756.aklaver@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)comcast(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2009-01-12 16:07:53 Re: Data comparison SQL in PG 8.2.9
Previous Message Grzegorz Jaśkiewicz 2009-01-12 11:47:24 Re: domain+enum