Re: Problem with newline/tab completing with psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Håvard Wahl Kongsgård <haavard(dot)kongsgaard(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with newline/tab completing with psql
Date: 2011-10-24 18:02:10
Message-ID: 4549.1319479330@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?ISO-8859-1?Q?H=E5vard_Wahl_Kongsg=E5rd?= <haavard(dot)kongsgaard(at)gmail(dot)com> writes:
> Hi, I have a problem with newline or tab completing when adding a
> generated FUNCTION via the psql interface (have tried pasting and
> adding it with -f rule.sql)

> parser stack overflow at or near "THEN"
> LINE 5002: ELSIF ( NEW.a between 1246566738 and 1247010220 ) THEN

That's pretty interesting. Could we see a complete (self-contained)
example of this problem, rather than a snippet? And what PG version
is this exactly?

Given that line number, though, I wonder whether your problem is that
you tried to put several thousand nested IFs into one plpgsql function.
If so, the answer is probably "refactor your code". You *will*
eventually hit this type of error if you nest stuff deeply enough.
I don't know exactly where the limit is, and it probably varies a
lot depending on platform, PG version, etc etc anyway.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomas Vondra 2011-10-24 18:11:57 Re: PostGIS in a commercial project
Previous Message Pavel Stehule 2011-10-24 17:49:29 Re: PostGIS in a commercial project