pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: Ivar Zarans <iff@alcaron.ee>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow UPADTE, compared to INSERT
Date: Fri, 05 Dec 2003 18:19:46 +0530
Message-ID: <3FD07EEA.8030007@persistent.co.in> (raw)
In-Reply-To: <20031205123843.GA27170@alcaron.ee>
References: <20031204185751.GA15893@alcaron.ee>
	<20031205014514.GA21079@alcaron.ee>
	<20031205020728.GA21440@alcaron.ee>
	<200312051008.20317.dev@archonet.com>
	<20031205123843.GA27170@alcaron.ee>

Ivar Zarans wrote:
> It seems, that PyPgSQL query quoting is not aware of this performance
> problem (to which Cristopher referred) and final query, sent to server
> is correct SQL, but not correct, considering PostgreSQL bugs.

Personally I don't consider a bug but anyways.. You are the one facing problem 
so I understand..

> Finally - what would be correct solution to this problem? Upgrading to
> 7.5 CVS is not an option :) One possibility is not to use PyPgSQL
> variable substitution and create every query "by hand" - not very nice
> solution, since variable substitution and quoting is quite convenient.
> 
> Second (and better) possibility is to ask PyPgSQL develeopers to take care
> of PostgreSQL oddities.
> 
> Any other suggestions?

I know zero in python but just guessing..

Will following help?

qry = "UPDATE table1 SET status = %s WHERE recid = '%s'"
cursor.execute(qry, status, recid)

  Just a thought..

  Shridhar




view thread (24+ messages)  latest in thread

Message-ID: <3FD07EEA.8030007@persistent.co.in>
Permalink:  ../3FD07EEA.8030007@persistent.co.in/
Also on:    postgresql.org/message-id/3FD07EEA.8030007@persistent.co.in

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: shridhar_daithankar@persistent.co.in, iff@alcaron.ee
  Subject: Re: Slow UPADTE, compared to INSERT
  In-Reply-To: <3FD07EEA.8030007@persistent.co.in>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox