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

From: DonnaR <donna(at)therudds(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I 'include' a stored procedure in a SQL script file
Date: 2009-01-12 11:14:56
Message-ID: 21412577.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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.

Andreas Kretschmer-4 wrote:
>
> In response to Donna Rudd :
>> Hi,
>> All I want to do is 'include' a stored procedure (contained in another
>> script file) into my main PostgreSQL database creation script file so
>> that
>> it can get defined/declared before I define my triggers to call it. It
>> seems
>> such a simple thing but I don't seem to be able to find any examples or
>> documentation. Please help!
>
> Your main script file is executed with psql? You can use \i <other_file>
> within your main-file.
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>

--
View this message in context: http://www.nabble.com/How-do-I-%27include%27-a-stored-procedure-in-a-SQL-script-file-tp21330479p21412577.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-01-12 11:47:24 Re: domain+enum
Previous Message Reg Me Please 2009-01-12 09:26:13 Re: Data comparison SQL in PG 8.2.9