Thread: PGAccess/pgplsql Blues

PGAccess/pgplsql Blues

From
"Josh Berkus"
Date:
Folks,
I've been having an annoying problem that I'm hoping someone else has
had and solved:
When I edit some of my more complex plpgsql functions using PGAccess,
the functions break and cannot be made to work again except by reloading
them from PLSQL/text.  All attempts to use the function after PGAccess
editing are met with: 'Parse error at or near ""'
Once the *identical* function text is reloaded via PSQL command-line,
however, the function works.
I'm using Postgres 7.1 RC2 and PGAccess 0.98.5.
                    -Josh


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: PGAccess/pgplsql Blues

From
Tom Lane
Date:
"Josh Berkus" <josh@agliodbs.com> writes:
>     When I edit some of my more complex plpgsql functions using PGAccess,
> the functions break and cannot be made to work again except by reloading
> them from PLSQL/text.  All attempts to use the function after PGAccess
> editing are met with: 'Parse error at or near ""'

Hmm, is it possible PGAccess is DOS-ifying the newlines?

At one point I fixed plpgsql to accept DOS-style newlines, but maybe
someone broke it again.  Or maybe that's not the problem, but it's
worth checking.
        regards, tom lane


Re: PGAccess/pgplsql Blues

From
Roberto Mello
Date:
On Fri, Jun 01, 2001 at 09:30:40AM -0700, Josh Berkus wrote:
> 
>     When I edit some of my more complex plpgsql functions using PGAccess,
> the functions break and cannot be made to work again except by reloading
> them from PLSQL/text.  All attempts to use the function after PGAccess
> editing are met with: 'Parse error at or near ""'
IIRC, pgaccess does quote-escaping for you, so if you try to write
"standard" PL/pgSQL (escaping single quotes), it'll barf this error.
Just something to check. 
-Roberto
-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU -
http://www.brasileiro.net      http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
 
I'm only a droid and not very knowledgeable about such things.


Re: PGAccess/pgplsql Blues

From
"Josh Berkus"
Date:
Roberto,

>  IIRC, pgaccess does quote-escaping for you, so if you try to write
> "standard" PL/pgSQL (escaping single quotes), it'll barf this error.
> 
>  Just something to check. 

Thanks.  This doesn't seem to be the case; it seems to be a translation
problem:

1. Test fn_save_order: it's working.
2. Open fn_save_order in PGAccess.
3. Add '--test comment' on its own line.
4. Save fn_save_order.
5. test it: "Parse Error at or near "" "

Unfortunately, I can't afford to pay Constatin for debugging, so that's
where things stand ...

-Josh


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: PGAccess/pgplsql Blues

From
Bruce Momjian
Date:
FYI, I could not reproduce this problem in the current CVS sources.

I created a function 'select 1;' and saved it, then opened the function
and added a comment line, saved that, and it worked fine.

> Roberto,
> 
> >  IIRC, pgaccess does quote-escaping for you, so if you try to write
> > "standard" PL/pgSQL (escaping single quotes), it'll barf this error.
> > 
> >  Just something to check. 
> 
> Thanks.  This doesn't seem to be the case; it seems to be a translation
> problem:
> 
> 1. Test fn_save_order: it's working.
> 2. Open fn_save_order in PGAccess.
> 3. Add '--test comment' on its own line.
> 4. Save fn_save_order.
> 5. test it: "Parse Error at or near "" "
> 
> Unfortunately, I can't afford to pay Constatin for debugging, so that's
> where things stand ...
> 
> -Josh
> 
> 
> ______AGLIO DATABASE SOLUTIONS___________________________
>                                        Josh Berkus
>   Complete information technology      josh@agliodbs.com
>    and data management solutions       (415) 565-7293
>   for law firms, small businesses        fax 621-2533
>     and non-profit organizations.      San Francisco
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: PGAccess/pgplsql Blues

From
"Josh Berkus"
Date:
Bruce,
     Thanks for checking that.   You actually missed the beginning of
the issue; it only crops up with long, complex functions > 100 lines
including nested text quoting.
     I'm getting out of the habit of using PGAccess for anything but
table lookups, anyway, so it's not worth it to me to hunt down the
issue.

-Josh

> FYI, I could not reproduce this problem in the current CVS sources.
> 
> I created a function 'select 1;' and saved it, then opened the
> function
> and added a comment line, saved that, and it worked fine.
> 
> > Roberto,
> > 
> > >  IIRC, pgaccess does quote-escaping for you, so if you try to
> write
> > > "standard" PL/pgSQL (escaping single quotes), it'll barf this
> error.
> > > 
> > >  Just something to check. 
> > 
> > Thanks.  This doesn't seem to be the case; it seems to be a
> translation
> > problem:
> > 
> > 1. Test fn_save_order: it's working.
> > 2. Open fn_save_order in PGAccess.
> > 3. Add '--test comment' on its own line.
> > 4. Save fn_save_order.
> > 5. test it: "Parse Error at or near "" "
> > 
> > Unfortunately, I can't afford to pay Constatin for debugging, so
> that's
> > where things stand ...
> > 
> > -Josh
> > 
> > 
> > ______AGLIO DATABASE SOLUTIONS___________________________
> >                                        Josh Berkus
> >   Complete information technology      josh@agliodbs.com
> >    and data management solutions       (415) 565-7293
> >   for law firms, small businesses        fax 621-2533
> >     and non-profit organizations.      San Francisco
> > 
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister
> command
> >     (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
> > 
> 
> -- 
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania
> 19026

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco