From: | jwp(at)pgfoundry(dot)org (James William Pye) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | python - be: Override linecache.updatecache to allow access to |
Date: | 2005-04-19 05:19:53 |
Message-ID: | 20050419051953.30E2A1FB6224@pgfoundry.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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)
From | Date | Subject | |
---|---|---|---|
Next Message | Teodor Sigaev | 2005-04-19 13:58:12 | pgsql: Add comment about permissions on pg_ts* tables |
Previous Message | Bruce Momjian | 2005-04-19 03:55:43 | pgsql: >>>>Luckily, PG 8 is available for this. |