python - be: Override linecache.updatecache to allow access to - Mailing list pgsql-committers

From jwp@pgfoundry.org (James William Pye)
Subject python - be: Override linecache.updatecache to allow access to
Date
Msg-id 20050419051953.30E2A1FB6224@pgfoundry.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Override linecache.updatecache to allow access to procedures.

This gives traceback.print_tb the ability to read pg_proc->prosrc by looking up
the proc entry if the filename is a single, base-10 number that strtol can take.
If an invalid Oid, fallback on the old function that we hold a reference for.

Change tbtostr to rely on traceback.print_tb instead of format_tb and concat'ing
the traceback string up ourselves. This now puts a dependency on cStringIO that
is distributed with Python(might need to change how's it's used, tho =\).

Spin off transform from compile as it's used in two places now, for validation
and for giving the source to linecache, as the hard coded line information in
the code object will cause referenced lines to be off by +1.

Use format_procedure for the function name; giving a more useful represention of
the function name in the traceback and anything that would reference it in the
code object.

Put _init in a critical section to cause FATALs.

Delete the Savepoint type from module as it was just a base type for a
Postgres.Transaction's Savepoint; inappropriate for the PL context.

Modified Files:
--------------
    be/src:
        pl.c (r1.6 -> r1.7)
        (http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/pl.c.diff?r1=1.6&r2=1.7)

pgsql-committers by date:

Previous
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: >>>>Luckily, PG 8 is available for this.
Next
From: teodor@svr1.postgresql.org (Teodor Sigaev)
Date:
Subject: pgsql: Add comment about permissions on pg_ts* tables