Re: Why does the PL/pgSQL compiler do this?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Moore <michaeljmoore(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Why does the PL/pgSQL compiler do this?
Date: 2016-11-01 02:38:53
Message-ID: 20520.1477967933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Michael Moore <michaeljmoore(at)gmail(dot)com> writes:
> I'm still a bit confused. If I replace the ROLLBACK; command with ELEPHANT;
> the result is a syntax error. Why doesn't ROLLBACK; produce the same error
> since it is not valid in the LANGUAGE plpgsql.

That's a runtime error so far as plpgsql is concerned, because it relies
on the SPI layer to throw the error. It might be practical to complain
about it at compile time, but it would be some extra code that nobody's
written.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Moore 2016-11-01 17:36:00 Re: Why does the PL/pgSQL compiler do this?
Previous Message Adrian Klaver 2016-11-01 01:20:45 Re: Why does the PL/pgSQL compiler do this?