Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8451589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:16:54+00:00 2026-06-10T11:16:54+00:00

I have a simple table (named test) as: id | integer name | character

  • 0

I have a simple table (named test) as:

id     | integer                
name   | character varying(100) 
intval | integer

When I try to use prepare statement to update the name like this in python. (I am using python-pgsql http://pypi.python.org/pypi/python-pgsql/)

>>> for i in db.execute("select * from test"): print i
...
(1, 'FOO', None)
>>> query = "UPDATE test set name = '$1' where name = '$2'"
>>> cu.execute(query, "myname", "FOO")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pgsql.py", line 119, in execute
    ret = self._source.execute(operation, params)
ProgrammingError: ERROR:  could not determine data type of parameter $1 

The demo file for the module can be seen at http://sprunge.us/VgLY?python.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:16:56+00:00Added an answer on June 10, 2026 at 11:16 am

    I’m guessing that it could be your single quotes around $1 and $2 inside your string. In the main changes from PYGresql it says that:

    • support for bind parameters, alleviating the need for extensive,
      expensive and vulnerable quoting of user-supplied data

    So I’m assuming the single quotes are overloading the string with too many quotes, or just breaking the parser in python-pgsql.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple database named customer with a single table data.I want to
I have a very simple MySQL table Name | Time | Count James |
Let's say I have a simple table of: id,name,salary The query I have is:
I have setup a simple Oracle external table test that I (alongside a DBA
I have a simple mysql table I want to use for daily stat tracking.
I have a simple JOINED hierarchy of documents: CREATE TABLE Documents ( id INTEGER
Say I have a table like this: Table name: Test col1 | col2 |
Here is my simple text (named test): name sex age height 1 x1 F
Let's assume we have this very simple 'test' table. There is: 5 bob, 2
I have a sample data table(id, name, date_create) table(1, 'Iphone 4S', '2012-06-18 17:19:05') //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.