python - be: Implement the new type system.

From: jwp(at)pgfoundry(dot)org (James William Pye)
To: pgsql-committers(at)postgresql(dot)org
Subject: python - be: Implement the new type system.
Date: 2005-10-21 21:55:15
Message-ID: 20051021215515.65E3D1125F45@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Implement the new type system.

This makes Postgres.Type a metaclass for Postgres.Object. Postgres.Object is a
proper Python type object. Extensions are made by subclassing Postgres.Object,
and associating the appropriate type identification information with the class.

This "bloats" the extension module by having most of the builtin types defined.
However, this provides the ability to customize the type interface per-type, as
opposed to "per-oid" crowded in src/object.c.

Additionally, describe function input using a PyPgTupleDesc. Arguments passed to
the function will be a HeapTuple of that descriptor.

Generator functionality has been changed. Non-SRF generators will not have the
'args' automatically updated. Rather, in preparation for 2.5(PEP 342)[1], look
at calling the 'send' method of the state object. SRFs are not effected by this
as there should be no expectation to get 'new' arguments.

Postgres.TupleDesc instances now require a single sequence object for
instantiating a HeapTuple. (As do/will PyPg_record_Types)

Prohibit COPY TO/FROM STDIO in Postgres.Query.

Start work to rid the repo of conv.c, tif.c, and utils.c.

Move the PostgreSQL extension from $libdir/pl/python-xy.so to $libdir/python-xy.so

[1] http://www.python.org/peps/pep-0342.html

Modified Files:
--------------
be:
setup.py (r1.17 -> r1.18)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/setup.py.diff?r1=1.17&r2=1.18)
be/include/pypg:
call.h (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/call.h.diff?r1=1.4&r2=1.5)
ci.h (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/ci.h.diff?r1=1.3&r2=1.4)
cis.h (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/cis.h.diff?r1=1.5&r2=1.6)
conv.h (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/conv.h.diff?r1=1.4&r2=1.5)
encoding.h (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/encoding.h.diff?r1=1.1&r2=1.2)
error.h (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/error.h.diff?r1=1.6&r2=1.7)
externs.h (r1.9 -> r1.10)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/externs.h.diff?r1=1.9&r2=1.10)
function.h (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/function.h.diff?r1=1.4&r2=1.5)
heaptuple.h (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/heaptuple.h.diff?r1=1.4&r2=1.5)
postgres.h (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/postgres.h.diff?r1=1.6&r2=1.7)
python.h (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/python.h.diff?r1=1.3&r2=1.4)
tupledesc.h (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/tupledesc.h.diff?r1=1.5&r2=1.6)
type.h (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type.h.diff?r1=1.7&r2=1.8)
utils.h (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/utils.h.diff?r1=1.4&r2=1.5)
be/include/pypg/call:
function.h (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/call/function.h.diff?r1=1.3&r2=1.4)
pl.h (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/call/pl.h.diff?r1=1.6&r2=1.7)
portal.h (r1.3 -> r1.4)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/call/portal.h.diff?r1=1.3&r2=1.4)
trigger.h (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/call/trigger.h.diff?r1=1.5&r2=1.6)
be/src:
call.c (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/call.c.diff?r1=1.6&r2=1.7)
conv.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/conv.c.diff?r1=1.7&r2=1.8)
encoding.c (r1.2 -> r1.3)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/encoding.c.diff?r1=1.2&r2=1.3)
error.c (r1.9 -> r1.10)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/error.c.diff?r1=1.9&r2=1.10)
function.c (r1.9 -> r1.10)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/function.c.diff?r1=1.9&r2=1.10)
globals.c (r1.8 -> r1.9)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/globals.c.diff?r1=1.8&r2=1.9)
heaptuple.c (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/heaptuple.c.diff?r1=1.6&r2=1.7)
module.c (r1.21 -> r1.22)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/module.c.diff?r1=1.21&r2=1.22)
namespace.c (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/namespace.c.diff?r1=1.5&r2=1.6)
pl.c (r1.25 -> r1.26)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/pl.c.diff?r1=1.25&r2=1.26)
prime.py (r1.9 -> r1.10)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/prime.py.diff?r1=1.9&r2=1.10)
query.c (r1.11 -> r1.12)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/query.c.diff?r1=1.11&r2=1.12)
relation.c (r1.5 -> r1.6)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/relation.c.diff?r1=1.5&r2=1.6)
tif.c (r1.8 -> r1.9)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/tif.c.diff?r1=1.8&r2=1.9)
tupledesc.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/tupledesc.c.diff?r1=1.7&r2=1.8)
type.c (r1.12 -> r1.13)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type.c.diff?r1=1.12&r2=1.13)
utils.c (r1.11 -> r1.12)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/utils.c.diff?r1=1.11&r2=1.12)
be/src/call:
function.c (r1.6 -> r1.7)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/call/function.c.diff?r1=1.6&r2=1.7)
pl.c (r1.10 -> r1.11)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/call/pl.c.diff?r1=1.10&r2=1.11)
portal.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/call/portal.c.diff?r1=1.7&r2=1.8)
trigger.c (r1.7 -> r1.8)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/call/trigger.c.diff?r1=1.7&r2=1.8)
be/test:
regress.py (r1.4 -> r1.5)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/test/regress.py.diff?r1=1.4&r2=1.5)
be/test/expected/80:
generator (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/test/expected/80/generator.diff?r1=1.1&r2=1.2)
trigger (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/test/expected/80/trigger.diff?r1=1.1&r2=1.2)
be/test/sql/80:
trigger (r1.1 -> r1.2)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/test/sql/80/trigger.diff?r1=1.1&r2=1.2)

Added Files:
-----------
be/include/pypg/type:
array.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/array.h?rev=1.1&content-type=text/x-cvsweb-markup)
bitwise.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/bitwise.h?rev=1.1&content-type=text/x-cvsweb-markup)
geometric.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/geometric.h?rev=1.1&content-type=text/x-cvsweb-markup)
network.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/network.h?rev=1.1&content-type=text/x-cvsweb-markup)
numeric.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/numeric.h?rev=1.1&content-type=text/x-cvsweb-markup)
object.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/object.h?rev=1.1&content-type=text/x-cvsweb-markup)
record.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/record.h?rev=1.1&content-type=text/x-cvsweb-markup)
system.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/system.h?rev=1.1&content-type=text/x-cvsweb-markup)
textual.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/textual.h?rev=1.1&content-type=text/x-cvsweb-markup)
timewise.h (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/type/timewise.h?rev=1.1&content-type=text/x-cvsweb-markup)
be/src/type:
array.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/array.c?rev=1.1&content-type=text/x-cvsweb-markup)
bitwise.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/bitwise.c?rev=1.1&content-type=text/x-cvsweb-markup)
geometric.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/geometric.c?rev=1.1&content-type=text/x-cvsweb-markup)
network.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/network.c?rev=1.1&content-type=text/x-cvsweb-markup)
numeric.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/numeric.c?rev=1.1&content-type=text/x-cvsweb-markup)
object.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/object.c?rev=1.1&content-type=text/x-cvsweb-markup)
record.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/record.c?rev=1.1&content-type=text/x-cvsweb-markup)
system.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/system.c?rev=1.1&content-type=text/x-cvsweb-markup)
textual.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/textual.c?rev=1.1&content-type=text/x-cvsweb-markup)
timewise.c (r1.1)
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/type/timewise.c?rev=1.1&content-type=text/x-cvsweb-markup)

Removed Files:
-------------
be/include/pypg:
object.h
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/object.h)
savepoint.h
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/savepoint.h)
transaction.h
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/include/pypg/transaction.h)
be/src:
object.c
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/object.c)
savepoint.c
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/savepoint.c)
transaction.c
(http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/python/be/src/transaction.c)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-10-21 22:09:00 Re: [COMMITTERS] pgsql: Do all accesses to shared buffer
Previous Message Neil Conway 2005-10-21 21:43:49 Re: [COMMITTERS] pgsql: Do all accesses to shared buffer