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

Discussion in 'Python' started by fowlertrainer@anonym.hu, May 4, 2004.

  1. Guest

    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.


    --
    Üdv/Kind of Regards:

    mailto:
     
    , May 4, 2004
    #1
    1. Advertising

  2. Lee Harr Guest

    On 2004-05-04, <> wrote:
    > 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.
     
    Lee Harr, May 4, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesse
    Replies:
    4
    Views:
    4,277
    Ryan Stewart
    Jun 6, 2004
  2. Shane Hathaway
    Replies:
    2
    Views:
    330
    Michael Hudson
    Aug 29, 2003
  3. =?ISO-8859-1?Q?Eino_M=E4kitalo?=
    Replies:
    1
    Views:
    451
    Max M
    Dec 9, 2004
  4. projecktzero
    Replies:
    4
    Views:
    602
    projecktzero
    Jun 28, 2005
  5. Jagan Jacob

    Access Postgre Sql

    Jagan Jacob, Nov 29, 2010, in forum: Ruby
    Replies:
    1
    Views:
    86
    Daniel Hernández
    Nov 29, 2010
Loading...

Share This Page