Re: sql query - create replace function

From: Richard Huxton <dev(at)archonet(dot)com>
To: iuri(dot)sampaio(at)computer(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: sql query - create replace function
Date: 2007-12-20 08:31:29
Message-ID: 476A2861.2060905@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Iuri Sampaio wrote:
> Hi all,
>
> I created a script to install postgresql. One of the steps is to run a sql
> query.
>
> the problem is that i need to run the query as postgres user, plus it needs
> to be at psql shell prompt command line, i.e:

Why does it need to be at the psql prompt?

> I expected something like
> su - postgres -c "pgsql dbname && create or replace function bitfromint4
> (integer) returns bit varying as ' begin return $1::bit(32); end;' language
> 'plpgsql' immutable str\
> ict;"

What's wrong with this?

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Philippe Lang 2007-12-21 10:33:40 Concatenation through SQL
Previous Message Iuri Sampaio 2007-12-20 05:29:13 sql query - create replace function