Re: PgSQL not recognized - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: PgSQL not recognized
Date
Msg-id 20061115202418.GA31020@svana.org
Whole thread Raw
In response to Re: PgSQL not recognized  ("whytwelve13@yahoo.com" <whytwelve13@yahoo.com>)
Responses Re: PgSQL not recognized
List pgsql-general
On Tue, Nov 14, 2006 at 12:28:33PM -0800, whytwelve13@yahoo.com wrote:
> Obviously not as good I should have. I missed the begin and the end,
> adding those solved the problem. I am new to Postgres and it is quite
> differently designed compared to what I have been using so far, I just
> thought I could step right into it and do as I used to.

I'm not sure where you're coming from but AIUI plpgsql is modelled on
the oracle language. I've never used oracle like that so can't really
comment how that compares to any other database.

> How do I ignore the error? The problem is that I would like to have a
> set of drop/create statements executed at once and one drop failing
> will abort the script execution. That is why I was searching for some
> conditional execution statement within the query. Did you mean using
> begin/exception for this or were you just talking about
> one-statement-per-query execution and "forgetting" about any possible
> exceptions?

Yes, I was thinking of begin/exception. You just make the exception do
nothing. I've never really done this though, I've never had dymanic
schema's that way.

> Nonetheless, can you use PL/PgSQL without building functions?

No, people suggest it from time to time, but I don't beleive anyone has
submitted a complete proposal or patch for it.

> This is
> what I have been used to while using other SQL implementations. Not
> related to the above problem - if a function can be built, then it can
> accept the catalog, schema and table name and check whether the table
> really exists using information_schema.tables. Just wondering, though,
> is this something that Postgres is not designed for or am I missing
> something that disallows me to run PL/PgSQL statements within "normal"
> queries?

You're not missing anything, the only language the database understands
directly is SQL, other languages are restricted to use within
functions.

The documentation is large. There has been some effort to get it into a
form more accessable, but it's hard when there's that much of it.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Joseph Shraibman
Date:
Subject: How to crash postgres using savepoints
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Using SAN Splits to instantly copy a DB