Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Federico Di Gregorio's latest activity

Tuesday, January 14 2014
190 Invalid json is returned for json column type was updated in psycopg
  • Federico Di Gregorio
    Federico Di Gregorio commented at 5:55 PM

    @Daniele: it is just that not all SQL types provide a register_default_xxx, only the new type-casters. So, I better like to use the low-level method in example ...

  • Federico Di Gregorio
    Federico Di Gregorio commented at 5:20 PM

    Just create and register a type-caster that returns JSON as text:

    JSONTEXT = psycopg2.extensions.new_type((114,), "JSONTEXT", (lambda value, curs: value))
    psyc...
  • Federico Di Gregorio
    Federico Di Gregorio edited a comment at 5:21 PM

    Just create and register a type-caster that returns JSON as text:

    JSONTEXT = psycopg2.extensions.new_type((114,), "JSONTEXT", (lambda value, curs: value))
    psyc...
  • Federico Di Gregorio
    Federico Di Gregorio commented at 4:52 PM

    @extesy, yes, I forgot that the result is a tuple even when you select just one column. See my edited answer.

  • Federico Di Gregorio
    Federico Di Gregorio commented at 3:58 PM

    That's just how Python formats a dictionary in a "print". If you try to access it you'll see that it is a perfectly valid:

    record = cur.fetchone()
    print record...
1 earlier change…
  • Federico Di Gregorio
    Federico Di Gregorio edited a comment at 4:52 PM

    That's just how Python formats a dictionary in a "print". If you try to access it you'll see that it is a perfectly valid:

    record = cur.fetchone()
    print record...
Friday, September 20 2013
180 Return number of rows for copy operations was updated in psycopg
  • Federico Di Gregorio
    Federico Di Gregorio commented at 2:05 PM

    If I remember correctly the libpq docs don't say if it is possible to
    retrieve the number of inserted columns and we're not sending data
    line-by-line but as chu...

  • Federico Di Gregorio
    Federico Di Gregorio created the ticket at 2:05 PM

    As asked by Ryan Kelly on the ML:

    I'm wondering if it's possible to get the number of rows copied when
    using copy_from? I would've thought the .rowcount attribu...

179 Mogrify performance on arrays was updated in psycopg
  • Federico Di Gregorio
    • State changed from invalid to open
    • Tag cleared.
    • Assigned user set to Federico Di Gregorio
    by Federico Di Gregorio at 12:35 PM

    Daniele, wait. He was talking about a simple benchmark and I can see where the bottleneck is. The mogrification of arrays is slow, because the arguments are che...

Friday, July 19 2013
172 row_to_json data gets interpreted was updated in psycopg
  • Federico Di Gregorio
    Federico Di Gregorio commented at 4:36 PM

    I have to agree. IMHO, the json adapter should exist but its registration should not be automatic.