On Tue, Nov 14, 2006 at 12:28:33PM -0800, [EMAIL PROTECTED] 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: signature.asc
Description: Digital signature

Reply via email to