From: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | "Richard Huxton" <dev(at)archonet(dot)com> |
Cc: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>, "Andreas Kretschmer" <akretschmer(at)spamfence(dot)net>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: loading a funtion script from a file |
Date: | 2007-11-21 17:35:21 |
Message-ID: | dcc563d10711210935o19f42c78s304890d6f1f047ef@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Nov 21, 2007 11:16 AM, Richard Huxton <dev(at)archonet(dot)com> wrote:
>
> Scott Marlowe wrote:
> > On Nov 21, 2007 10:49 AM, Richard Huxton <dev(at)archonet(dot)com> wrote:
> >> Gauthier, Dave wrote:
> >>> APparently, from "man psql", -c can do only one thing at a time. But you could do this with 2-3 commands (or 1 if you want to wrap the 2 up in a shell script or something). Here's an example...
> >> [snip]
> >>> psql --dbname mydb -c "\i create_try.sql;"
> >>> psql --dbname mydb -c "select trythis('foo');"
> >>> psql --dbname mydb -c "drop function trythis(varchar);"
> >> Or just put everything in one file and use -f <filename>
> >
> > And from the more than one way to skin a cat department:
> >
> > cat my.sql | psql mydb
> > psql mydb < my.sql
>
> Bearing in mind that although both mine and Scott's cats are skinless,
> mine gave me line numbers in error messages.
So do both of mine... In fact, trying all four ways (\i, cat | psql,
psql < file.sql, and psql -f file) gave me the same error output.
From | Date | Subject | |
---|---|---|---|
Next Message | Marco Colombo | 2007-11-21 17:44:22 | Re: Restart a sequence regularly |
Previous Message | Tom Lane | 2007-11-21 17:17:06 | Re: Postgres table size |