Re: Basic problems using plpythonu - bug?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Curt Schwaderer <curt(dot)schwaderer(at)mchsi(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Basic problems using plpythonu - bug?
Date: 2006-02-17 17:57:32
Message-ID: 20060217175732.GA45419@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 17, 2006 at 11:38:21AM -0600, Curt Schwaderer wrote:
> ERROR: plppython: function "send_ctl_msg" failed
> DETAIL: exceptions.KeyError: 'cfgCmd'

You're getting bit by case folding of identifiers. You created
the column as:

> cfgCmd VARCHAR(16), -- ENS configuration control command

Since you didn't quote the identifier it's folded to lowercase, so
when you refer to it as

> ens_cmd = rv[0]["cfgCmd"]

you get a KeyError exception. Try using rv[0]["cfgcmd"]. You might
want to read the documentation about quoted identifiers:

http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2006-02-17 18:15:17 Re: A question about Vacuum analyze
Previous Message Teodor Sigaev 2006-02-17 17:55:27 Re: TSearch2 / German compound words / UTF-8