[BUGS] Bug #879: python interface broken by removal of pg_type.typprtlen
Peter Harris ([EMAIL PROTECTED]) reports a bug with a severity of 2 The lower the number the more severe it is. Short Description python interface broken by removal of pg_type.typprtlen Long Description Version 7.3.1, pg_type seems to no longer have a column called typprtlen. This is OK by me, as that column is considered 'unused'. However: src/interfaces/python/pgdb.py expects it to be there, (line 150): "SELECT typname, typprtlen, typlen " "FROM pg_type WHERE oid = %s" % oid ALL queries through pgdb.py fail with a traceback: Traceback (most recent call last): File "", line 1, in ? File "/free/lib/python2.2/site-packages/pgdb.py", line 189, in execute self.executemany(operation, (params,)) File "/free/lib/python2.2/site-packages/pgdb.py", line 221, in executemany desc = typ[1:2]+self.__cache.getdescr(typ[2]) File "/free/lib/python2.2/site-packages/pgdb.py", line 149, in getdescr self.__source.execute( _pg.error: ERROR: Attribute "typprtlen" not found The field is returned as part of the return value of the cursor.description() method for Python's DB API v2.0, but I don't know of any requirement for what the value is. Accordingly, I am working around this by replacing with: "SELECT typname, typlen as typprtlen, typlen " in pgdb.py Sample Code python >>> import pgdb >>> db=pgdb.connect(host=...,database=...,user=...,password=...) >>> cur=db.cursor() >>> cur.execute("select * from some_table") ... dies with traceback, as described. No file was uploaded with this report ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [BUGS] Bug #879: python interface broken by removal of pg_type.typprtlen
[EMAIL PROTECTED] writes: > python interface broken by removal of pg_type.typprtlen Yeah, this is known and already fixed. But thanks for the report. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[BUGS] readline usage in psql...
A dump from using psql this is one of those helpful, "I have no clue what's causing this, but here it is for the record or someone who knows more than I." I don't know if it's a readline() problem or something in PQclientEncoding(), and neither of which I have any experience with. If I figure out what's causing it beyond pushing "Ctrl+something" with a halfway completed connect command (\c datab[ctrl+???]), I'll post a reply w/ more info. -sc #0 0x281cbaeb in sigprocmask () from /usr/lib/libc.so.5 #1 0x280c5a2a in _rl_savestring () from /usr/lib/libreadline.so.4 #2 #3 0x28168803 in read () from /usr/lib/libc.so.5 #4 0x280c1c79 in rl_read_key () from /usr/lib/libreadline.so.4 #5 0x280d407f in readline_internal_char () from /usr/lib/libreadline.so.4 #6 0x280d4235 in readline_internal_char () from /usr/lib/libreadline.so.4 #7 0x280d426e in readline_internal_char () from /usr/lib/libreadline.so.4 #8 0x280d3dad in readline () from /usr/lib/libreadline.so.4 #9 0x0804ede4 in PQclientEncoding () at fe-connect.c:2725 #10 0x0804f697 in PQclientEncoding () at fe-connect.c:2725 #11 0x08051653 in PQclientEncoding () at fe-connect.c:2725 #12 0x0804a485 in PQclientEncoding () at fe-connect.c:2725 -- Sean Chittenden ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [BUGS] readline usage in psql...
Sean Chittenden <[EMAIL PROTECTED]> writes: > #0 0x281cbaeb in sigprocmask () from /usr/lib/libc.so.5 > #1 0x280c5a2a in _rl_savestring () from /usr/lib/libreadline.so.4 > #2 > #3 0x28168803 in read () from /usr/lib/libc.so.5 > #4 0x280c1c79 in rl_read_key () from /usr/lib/libreadline.so.4 > #5 0x280d407f in readline_internal_char () from /usr/lib/libreadline.so.4 > #6 0x280d4235 in readline_internal_char () from /usr/lib/libreadline.so.4 > #7 0x280d426e in readline_internal_char () from /usr/lib/libreadline.so.4 > #8 0x280d3dad in readline () from /usr/lib/libreadline.so.4 > #9 0x0804ede4 in PQclientEncoding () at fe-connect.c:2725 > #10 0x0804f697 in PQclientEncoding () at fe-connect.c:2725 > #11 0x08051653 in PQclientEncoding () at fe-connect.c:2725 > #12 0x0804a485 in PQclientEncoding () at fe-connect.c:2725 I don't believe a word of this backtrace; PQclientEncoding isn't recursive and it doesn't call readline. Possibly the stack is already corrupt by the time the coredump occurs? regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [BUGS] readline usage in psql...
> > #0 0x281cbaeb in sigprocmask () from /usr/lib/libc.so.5 > > #1 0x280c5a2a in _rl_savestring () from /usr/lib/libreadline.so.4 > > #2 > > #3 0x28168803 in read () from /usr/lib/libc.so.5 > > #4 0x280c1c79 in rl_read_key () from /usr/lib/libreadline.so.4 > > #5 0x280d407f in readline_internal_char () from /usr/lib/libreadline.so.4 > > #6 0x280d4235 in readline_internal_char () from /usr/lib/libreadline.so.4 > > #7 0x280d426e in readline_internal_char () from /usr/lib/libreadline.so.4 > > #8 0x280d3dad in readline () from /usr/lib/libreadline.so.4 > > #9 0x0804ede4 in PQclientEncoding () at fe-connect.c:2725 > > #10 0x0804f697 in PQclientEncoding () at fe-connect.c:2725 > > #11 0x08051653 in PQclientEncoding () at fe-connect.c:2725 > > #12 0x0804a485 in PQclientEncoding () at fe-connect.c:2725 > > I don't believe a word of this backtrace; PQclientEncoding isn't > recursive and it doesn't call readline. > > Possibly the stack is already corrupt by the time the coredump > occurs? Very very possible. I was sitting there at a psql prompt: \c datab(ctrl+key I brushed against, but didn't intentionally push) and next thing I knew I was back at a shell prompt, core dumped. ::scratches head:: After looking at the backtrace, I didn't know what to make of it other than that it was unusual to say the least and I couldn't figure out a good place to start poking at the code to possibly submit a patch, so I punted. :-/ I'll see if I can't get more info if I run across this again. -sc GNU gdb 5.2.1 (FreeBSD) -- Sean Chittenden ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [BUGS] readline usage in psql...
Sean Chittenden <[EMAIL PROTECTED]> writes: > Very very possible. I was sitting there at a psql prompt: > \c datab(ctrl+key I brushed against, but didn't intentionally push) > and next thing I knew I was back at a shell prompt, core dumped. You sure you didn't send it a SIGQUIT with that ctrl-key combination? This may just be the terminal driver doing what it's supposed to ... regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])