[off] Zope - Please help me ! Postgre DA Field Types

F

fowlertrainer

Hello !

Hello !

I want to continue the my project.
http://www.zope.org/Members/fowlertrainer

I need to get all of the base field types with postgresql da.
http://www.zope.org/Members/spinwing/ZSQL_Results

rec = context.retrieve_fields_from_test_table()
print "-" * 80
print "Table field names"
print "-" * 80
for name in rec.names():
print name

print "-" * 80
print "Fields definitions"
print "-" * 80
dict = rec.data_dictionary()
for key in dict.keys():
print dict[key]

Base field types:
- char
- varchar
- int
- smallint
- bigint
- float
- decimal
- boolean
- blob
- memo
- double prec.
- text
- date
- time
- timestamp

The fields must be named f*, where * is the type of field. Example:
fint, fchar, fmemo.

Because I have not postgresql server (windows :-( ), anybody help me
to I get the field types ?

Example - The MySQL field types:

{'name': 'fbool', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fbit', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fdate', 'type': 'd', 'null': 1, 'width': 0}
{'name': 'ftime', 'type': 't', 'null': 1, 'width': 0}
{'name': 'fdouble', 'type': 'n', 'null': 1, 'width': 0}
{'name': 'fyear', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fdatetime', 'type': 'd', 'null': 1, 'width': 0}
{'name': 'finteger', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fchar', 'type': 't', 'null': 1, 'width': 0}
{'name': 'ftext', 'type': 't', 'null': 1, 'width': 0}
{'name': 'fvarchar', 'type': 't', 'null': 1, 'width': 0}
{'name': 'fts', 'type': 'd', 'null': 0, 'width': 0}
{'name': 'ftinyint', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'id', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fblob', 'type': 't', 'null': 1, 'width': 0}
{'name': 'fmediumint', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fsmallint', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fnumeric', 'type': 'n', 'null': 1, 'width': 0}
{'name': 'fint', 'type': 'i', 'null': 1, 'width': 0}
{'name': 'fdecimal', 'type': 'n', 'null': 1, 'width': 0}
{'name': 'fbigint', 'type': 'l', 'null': 1, 'width': 0}
{'name': 'ffloat', 'type': 'n', 'null': 1, 'width': 0}
{'name': 'freal', 'type': 'n', 'null': 1, 'width': 0}

Can anybody help me ?

Thanx for it.
 
L

Lee Harr

Hello !

Hello !

I want to continue the my project.
http://www.zope.org/Members/fowlertrainer

I need to get all of the base field types with postgresql da.
http://www.zope.org/Members/spinwing/ZSQL_Results


Not exactly what you are looking for but...
http://www.postgresql.org/docs/7.4/static/datatype.html

Or maybe you could get something from the information_schema
http://www.postgresql.org/docs/7.4/static/information-schema.html
http://www.postgresql.org/docs/7.4/static/infoschema-datatypes.html
http://www.postgresql.org/docs/7.4/static/infoschema-columns.html

Probably best to ask on one of the postgres lists.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top