Skip site navigation (1) Skip section navigation (2)

How to call Postgresql Array Function in Python

From: Rehan Saleem <pk_rehan(at)yahoo(dot)com>
To: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: How to call Postgresql Array Function in Python
Date: 2012-03-09 12:00:37
Message-ID: 1331294437.66636.YahooMailNeo@web121603.mail.ne1.yahoo.com (view raw or flat)
Thread:
Lists: psycopg
hi , 
i am trying to call the postgresql function which takes array of type integer which deletes the customer record from table . which is 

select delcustumer('{6}')  -- where 6 is the customer id

Now i am trying to call this postgresql function in python and i dont know how to pass array in python here is my python code

i have declared a argv called custid in my python file 

cust =  connection.db_rel ( "select delcustumer('{}')")
return cust

how can i pass my variable custid which is an element of array which postgresql function is taking to this function in python .
i shall be very thankful to you 

Responses

psycopg by date

Next:From: Daniele VarrazzoDate: 2012-03-09 12:41:35
Subject: Re: How to call Postgresql Array Function in Python
Previous:From: Brian HamlinDate: 2012-02-15 07:27:29
Subject: Mac OS 10.7x ??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group