Re: [SQL] info is a reserved word?

2006-01-12 Thread Michael Fuhr
On Thu, Jan 12, 2006 at 11:21:28PM -0500, Tom Lane wrote: > plpgsql is not very good about reserving words "minimally", ie, not > treating a word as a keyword outside the context where the keyword > is meaningful. > > This could probably be fixed, or at least greatly reduced, with some > flex/biso

Re: [SQL] info is a reserved word?

2006-01-12 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > 'info' only seems special in PL/pgSQL, presumably because it's one > of the possible RAISE levels. You should also get an error if you > try 'exception', 'warning', etc. plpgsql is not very good about reserving words "minimally", ie, not treating a word

Re: [SQL] info is a reserved word?

2006-01-12 Thread Michael Fuhr
On Thu, Jan 12, 2006 at 08:14:42PM -0500, John DeSoi wrote: > I have two identical functions below, the only difference is I > declared my variable name to be 'info' instead of 'stuff'. I could > not find anywhere in the docs that 'info' has any special meaning. 'info' only seems special in

[SQL] info is a reserved word?

2006-01-12 Thread John DeSoi
I have two identical functions below, the only difference is I declared my variable name to be 'info' instead of 'stuff'. I could not find anywhere in the docs that 'info' has any special meaning. Did I miss it? create type my_info as ( a text, b text ); -- this works crea

Re: [SQL] exceptions in rules

2006-01-12 Thread Markus Schaber
Hi, chester, chester c young wrote: > is there any way within a rule to raise an exception? Oh, so you know about rules - why did you ask for them before? You can use a plsql function to raise, if you don't find an easier way. Markus -- Markus Schaber | Logical Tracking&Tracing International

Re: [SQL] plpgsql triggers in rules

2006-01-12 Thread Markus Schaber
Hi, Chester, chester c young wrote: > is is possible for to have a "do instead" trigger on a view that is a > plpgsql function? Kinda. They're called "rules", not "triggers". See http://www.postgresql.org/docs/8.1/interactive/rules.html HTH, Schabi -- Markus Schaber | Logical Tracking&Tracing

Re: [SQL] foreign keys with on delete cascade and triggers

2006-01-12 Thread Tom Lane
Dirk Jagdmann <[EMAIL PROTECTED]> writes: > Now I'd like to know if the current order of deletions in PostgreSQL > is intended in the top-down way or if that could be changed? Sorry, I don't see much chance of changing it. regards, tom lane ---(end

Re: [SQL] foreign keys with on delete cascade and triggers

2006-01-12 Thread Dirk Jagdmann
Hello Tom, > If you want the whole transaction rolled back, raise an error instead > of returning NULL. You're right, that's working. But now I have a slightly different problem. I assume that the trigger which watches the cascaded deletions first deletes the row in the monitored table and then

[SQL] error code invalid_input_syntax

2006-01-12 Thread Rainer Leo
I wrote a function which generates SQL statements for INSERTs and UPDATEs, in which I cast the values to the correct datatype. Now I want to catch ERROR: invalid input syntax for integer: "i" but although I tried quite a few I can't find the right error code for this exception. Is it possible