pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
tip: weird parse error for pl/pgsql
2+ messages / 2 participants
[nested] [flat]

* tip: weird parse error for pl/pgsql
@ 2000-08-22 11:16  Keith Wong <keith@e-magine.com.au>
  0 siblings, 1 reply; 2+ messages in thread

From: Keith Wong @ 2000-08-22 11:16 UTC (permalink / raw)
  To: pgsql-sql

Hi everyone,

After fiddling for about a day to work out why my pl/pgsql stored 
procedures weren't working I finally
discovered why. It seems that pl/pgsql has a problem parsing Window style 
new line characters. I
was writing my stored procedures using a Windows app, and then running them 
on my Linux
Postgres database. It keeped on giving me...
an error found one line 1 near " "
which wasn't very helpful.

Anyway just make sure you write your stored procs in your Unix environment 
or save them as Unix
format. I hope this tip saves somebody some time. :)

Cheers,
Keith.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: tip: weird parse error for pl/pgsql
@ 2000-08-22 15:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Keith Wong <keith@e-magine.com.au>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2000-08-22 15:03 UTC (permalink / raw)
  To: Keith Wong <keith@e-magine.com.au>; +Cc: pgsql-sql

Keith Wong <keith@e-magine.com.au> writes:
> It seems that pl/pgsql has a problem parsing Window style 
> new line characters.

Ah-hah, good catch!  I have fixed this bug for 7.1.  If you want to
patch your local copy, the critical changes are:


inline patch 1: src/pl/plpgsql/src/scan.l (+2/-2 lines) download inline-1.patch*** src/pl/plpgsql/src/scan.l.orig Thu Jun 22 19:08:34 2000 --- src/pl/plpgsql/src/scan.l Tue Aug 22 10:59:28 2000 *************** *** 143,155 **** * Ignore whitespaces but remember this happened * ---------- */ ! [ \t\n]+ { plpgsql_SpaceScanned = 1; } /* ---------- * Eat up comments * ---------- */ ! --[^\n]* ; \/\* { start_lineno = yylineno; BEGIN IN_COMMENT; } --- 146,158 ---- * Ignore whitespaces but remember this happened * ---------- */ ! [ \t\r\n]+ { plpgsql_SpaceScanned = 1; } /* ---------- * Eat up comments * ---------- */ ! --[^\r\n]* ; \/\* { start_lineno = yylineno; BEGIN IN_COMMENT; }
regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-08-22 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-08-22 11:16 tip: weird parse error for pl/pgsql Keith Wong <keith@e-magine.com.au>
2000-08-22 15:03 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox