Re: protect psycopg script from sql injection?

2014-06-26 Thread Peter Otten
celati Laurent wrote: > I coded this following python script via psycopg; > > web_service_test.py > <http://python.6.x6.nabble.com/file/n5062113/web_service_test.py> > > 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? No, but you

Re: protect psycopg script from sql injection?

2014-06-25 Thread MRAB
On 2014-06-25 22:58, celati Laurent wrote: Hello, I coded this following python script via psycopg; web_service_test.py <http://python.6.x6.nabble.com/file/n5062113/web_service_test.py> 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? 2/ Could yo

protect psycopg script from sql injection?

2014-06-25 Thread dandrigo
Hello, I coded this following python script via psycopg; web_service_test.py <http://python.6.x6.nabble.com/file/n5062113/web_service_test.py> 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? 2/ Could you tell me how to protect this script fro

protect psycopg script from sql injection?

2014-06-25 Thread celati Laurent
Hello, I coded this following python script via psycopg; web_service_test.py <http://python.6.x6.nabble.com/file/n5062113/web_service_test.py> 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? 2/ Could you tell me how to protect this script from SQL i

Re: Psycopg Documentation

2009-03-29 Thread Albert Hopkins
On Sun, 2009-03-29 at 11:35 +0100, taliesin wrote: > Hi, > > I'm probably being very dense so apologies in advance, but I can't find > any decent documentation for the psycopg module for PostgreSQL interfacing. > > Google and Yahoo don't seem to return much for

Re: Psycopg Documentation

2009-03-29 Thread taliesin
Diez B. Roggisch wrote: > taliesin schrieb: >> Hi, >> >> I'm probably being very dense so apologies in advance, but I can't find >> any decent documentation for the psycopg module for PostgreSQL >> interfacing. >> >> Google and Yahoo don'

Re: Psycopg Documentation

2009-03-29 Thread Diez B. Roggisch
taliesin schrieb: Hi, I'm probably being very dense so apologies in advance, but I can't find any decent documentation for the psycopg module for PostgreSQL interfacing. Google and Yahoo don't seem to return much for any of the queries I gave them and what's listed as the

Psycopg Documentation

2009-03-29 Thread taliesin
Hi, I'm probably being very dense so apologies in advance, but I can't find any decent documentation for the psycopg module for PostgreSQL interfacing. Google and Yahoo don't seem to return much for any of the queries I gave them and what's listed as the homepage for p

Re: psycopg

2007-12-12 Thread J. Clifford Dyer
On Wed, Dec 12, 2007 at 09:08:44AM -0500, Calvin Spealman wrote regarding Re: psycopg: > >Don't do that, for a number of reasons. String concatenation is really >never a good idea and formatting your own query strings is exactly what >leads to things like sql inje

Re: psycopg

2007-12-12 Thread Calvin Spealman
Don't do that, for a number of reasons. String concatenation is really never a good idea and formatting your own query strings is exactly what leads to things like sql injection. Let the db library handle it for you: cur.execute('insert into seq(id,sequence) values(3, %s)', (content,)) Not

psycopg

2007-12-12 Thread sujitha mary
hi all, while executing this cur.execute('insert into seq(id,sequence) values(3,'+content+')') i'm getting an error psycopg2.ProgrammingError: syntax error at or near "prophage" LINE 1: insert into seq(id,sequence) values(3,Tum2 prophage complete... -- http://mail.python.org/mailman/listinfo/pyth

Re: your opinion about psycopg vs pygresql

2006-12-21 Thread Maxim Sloyko
ment I don't even have a clue how they > differ and on what reason, why does PostgreSQL seem to favour pygresql > and Pythoneers psycopg? > > Thanks in advance. Well, my info can be a little out of date, since I researched this problem more than a year ago. AFAIK, psycopg still lacks

Re: your opinion about psycopg vs pygresql

2006-12-20 Thread johnf
ing the pg api. > > But I was intrigued by this problem and started googling and by that > time I've noticed that python projects like Django seem to favor the > psycopg module. > > So I installed that one (the 1.1 version, since Django uses that too) > and it looked like it

your opinion about psycopg vs pygresql

2006-12-20 Thread Martin P. Hellwig
nd by that time I've noticed that python projects like Django seem to favor the psycopg module. So I installed that one (the 1.1 version, since Django uses that too) and it looked like it has the same problem of creating a user after a database, I'm sure that there is a user erro

psycopg: tz import error

2006-10-06 Thread km
Hi all,i have python 2.4.3 and 2.5 versions installed default python interpreter being  2.5have compiled psycopg2 with python2.4.3 setup.py.install , it installs in site-setup of 2.4.3 but when i login as a normal user and get into interctive python prompt of 2.4.3 ,  and " import tz " fails to im

Re: inserting/retriving dates in psycopg

2006-01-05 Thread Michele Simionato
Frank Millan: > Perhaps if you explain what you are trying to do, I may be able to > suggest something. I am looking for an adaptation/type cast mechanism and looking at the sources I think I have found it in doc/examples/usercast.py. I am doing some experiment now ... Michele Simionato -- h

Re: inserting/retriving dates in psycopg

2006-01-05 Thread Frank Millman
ombine(dat,dt.time(0)) # convert to datetime > > This is exactly the type checking I would like to avoid :-/ > > Michele Simionato psycopg returns a datetime.datetime object from a TIMESTAMP column, and a datetime.date object from a DATE column. You should not have to do a

Re: inserting/retriving dates in psycopg

2006-01-05 Thread Michele Simionato
Frank Millman: > import datetime as dt > def DbToDate(dat): >if isinstance(dat,dt.datetime): >return dat # already in datetime format >if isinstance(dat,dt.date): >return dt.datetime.combine(dat,dt.time(0)) # convert to datetime This is exactly the type checking I would

Re: inserting/retriving dates in psycopg

2006-01-05 Thread Frank Millman
Michele Simionato wrote: > Look at this example: > > >>> import psycopg > >>> psycopg.__version__ > '1.1.19' > >>> import datetime > >>> today = datetime.datetime.today() > >>> co = psycopg.connect('') >

inserting/retriving dates in psycopg

2006-01-04 Thread Michele Simionato
Look at this example: >>> import psycopg >>> psycopg.__version__ '1.1.19' >>> import datetime >>> today = datetime.datetime.today() >>> co = psycopg.connect('') >>> cu = co.cursor() >>> cu.execute('CRE

Re: Find out the schema with psycopg?

2005-12-24 Thread Steve Holden
Ben Hutchings wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>>I am trying to discover the schema of a PostgreSQL database >>>programatically at runtime. >>> >>>I'm using psycopg (I assume that&

Re: Find out the schema with psycopg?

2005-12-23 Thread Ben Hutchings
Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> I am trying to discover the schema of a PostgreSQL database >> programatically at runtime. >> >> I'm using psycopg (I assume that's still the best library). Is there a >> wa

Re: Find out the schema with psycopg?

2005-12-22 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I am trying to discover the schema of a PostgreSQL database > programatically at runtime. > > I'm using psycopg (I assume that's still the best library). Is there a > way to query the schema other than opening a system pipe like "psql -d &

Find out the schema with psycopg?

2005-12-21 Thread survivalist
I am trying to discover the schema of a PostgreSQL database programatically at runtime. I'm using psycopg (I assume that's still the best library). Is there a way to query the schema other than opening a system pipe like "psql -d '\d'", "psql -d '\d table

Intalling psycopg

2005-08-14 Thread ys
Hi I am getting "ImportError: No module named psycopg" i downloaded windows binary from http://stickpeople.com/projects/python/win-psycopg/ It is intalled in python24\lib\site-packages\psycopg2\ please help! Thanks YS -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg simplest problem

2005-07-08 Thread Gerhard Häring
Glauco wrote: > [...] > Gerhard thank you very much, this example explain me some idea, but > anyway don't resolve the core question. > In you example when dateVal is a None or textVal is none. > argument x must be DateTime, not None. > so i must manipulate for the empty string or None cases No,

Re: psycopg simplest problem

2005-07-08 Thread Glauco
""" > insert into mytable(myint, mytext, mydate) > values (%s, %s, %s) > """, (intval, textVal, dateVal)) > > The execute(many) method has an optional second parameter, which is a > tuple of values for your parametrized query. > > There are

Re: psycopg simplest problem

2005-07-08 Thread Gerhard Haering
ecute(many) method has an optional second parameter, which is a tuple of values for your parametrized query. There are different styles to parametrize queries among the various DB-API modules. psycopg uses the pyformat one, where you just use %s as placeholders. It will happily quote all Pyth

psycopg simplest problem

2005-07-08 Thread Glauco
(myint, mytext, maydate) values (%s,%s,%s);""" % (myvalue1, myvalue2, myvalue3) without all time check for none, empty string and so on... I've seen API of psycopg and s

Re: psycopg authentication

2005-03-12 Thread [EMAIL PROTECTED]
Thanks for the reply. I figured it out, the problem was with my postgresql configuration. the following seemed to do the trick. localall md5 host all 0.0.0.0 0.0.0.0 md5 -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg authentication

2005-03-12 Thread [EMAIL PROTECTED]
I did, the pg_hba conf is a big tricky to me. I've tried the following things.. the commented out lines I also tried. #localall ident sameuser localall md5 host all 127.0.0.1 255

Re: psycopg authentication

2005-03-12 Thread Lee Harr
On 2005-03-12, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, I'm new to both PostgreSQL and psycopg and I'm trying to connect > to my database running on localhost. I have postgres setup to do md5 > authentication and this works when using a db admin tool on my

psycopg authentication

2005-03-11 Thread [EMAIL PROTECTED]
Hello, I'm new to both PostgreSQL and psycopg and I'm trying to connect to my database running on localhost. I have postgres setup to do md5 authentication and this works when using a db admin tool on my local network. For some reason, psycopg fails with IDENT authentication. >>

Re: Psycopg 1.1.17 compiled binaries for windows, postgre 8.0.0-beta4 and python 2.3

2004-12-09 Thread Max M
Eino Mäkitalo wrote: I had Visual C++ 6.0, so I compiled those libpq.dll and psycopg.pyd. if there are anyone to play with Windows, Python 2.3 and Postgre-8.0.0-beta4 for windows like me. You cat get those from: http://eino.net/html/python.html Original psycopg source code is available in: http

Psycopg 1.1.17 compiled binaries for windows, postgre 8.0.0-beta4 and python 2.3

2004-12-09 Thread Eino Mäkitalo
I had Visual C++ 6.0, so I compiled those libpq.dll and psycopg.pyd. if there are anyone to play with Windows, Python 2.3 and Postgre-8.0.0-beta4 for windows like me. You cat get those from: http://eino.net/html/python.html Original psycopg source code is available in: http://initd.org/projects