Re: psql default language

From: Iker Arizmendi <iker(at)research(dot)att(dot)com>
To: Oliver Vecernik <vecernik(at)aon(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql default language
Date: 2003-01-30 22:43:47
Message-ID: 20030130174347.62c5aa89.iker@research.att.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to run scripts with \i from psql and would like to be able to
use conditional statements (and other PL niceness). Eg,

IF (EXISTS(SELECT 1 FROM pg_type WHERE typname = 'mytype')) THEN
DROP TYPE mytype;
END IF;

(Granted, in this example, you can just drop the type and ignore the
warning, but I still think a conditional check is cleaner).

This has been discussed on the list before and IIRC, the suggestion was
to write PL/pgsql functions to do what you want but I was wondering if
7.3.x had been changed to allow this.

Iker

On Thu, 30 Jan 2003 23:29:23 +0100
Oliver Vecernik <vecernik(at)aon(dot)at> wrote:

> Iker Arizmendi schrieb:
>
> >Can postgres/psql be configured to allow PL/pgsql at the prompt?
> >
> What exactly do you want to do?
>
> Oliver
>
> --
> VECERNIK Datenerfassungssysteme
> A-2560 Hernstein, Hofkogelgasse 17
> Tel.: +43 2633 47530, Fax: DW 50
> http://members.aon.at/vecernik
>
>
>

--
Iker Arizmendi
AT&T Labs - Research
Speech and Image Processing Lab
e: iker(at)research(dot)att(dot)com
w: http://research.att.com
p: 973-360-8516

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas T. Thai 2003-01-30 22:59:50 Re: text searching in postgres
Previous Message Giles Lean 2003-01-30 22:33:37 Re: Postgres server output logfile