Re: BUG #1956: Plpgsql top-level DECLARE does not share scope

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: BUG #1956: Plpgsql top-level DECLARE does not share scope
Дата
Msg-id 20051013171110.GY23883@pervasive.com
обсуждение исходный текст
Ответ на Re: BUG #1956: Plpgsql top-level DECLARE does not share scope  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: BUG #1956: Plpgsql top-level DECLARE does not share scope  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Thu, Oct 13, 2005 at 10:38:36AM -0400, Bruce Momjian wrote:
> Karl O. Pinc wrote:
> >
> > On 10/12/2005 10:32:20 PM, Bruce Momjian wrote:
> >    We tend to follow the C conventions, so perhaps we
> > > should
> > > throw a warning, but I can't think of any cases where we throw a
> > > warning
> > > in plpgsql because we compile it once on first call.
> > >
> > > I am thinking this falls in the "don't do that" category.
> >
> > Fair enough.  At the same time it sure would be nice if
> > plpgsql actually compiled (and parsed SQL) at
> > function definition time, even when the result is thrown away.
> > I'm building a big system and it's quite annoying
> > to get syntax errors, IIRC,
> > in code months after writing it, just because it took
> > me that long to get around to exercising a particular
> > IF statement.
>
> 8.0 has this improvement:
>
>      * Do minimal syntax checking of PL/pgSQL functions at creation time (Tom)
>        This allows us to catch simple syntax errors sooner.

Based on all that, I would certainly be in favor of throwing a warning
if you over-define something, since 99% of the time it's a mistake. Is
that possible with the current checking we do at compile time?
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1959: readline error exiting psql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1956: Plpgsql top-level DECLARE does not share scope