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 might find out yourself. When you remove
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 injections please
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 injections please
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 you tell me how
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 psycopg is this:
http
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 homepage for psycopg
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't seem to return much for any of the queries I gave
them and what's listed
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 any of the queries I gave
them
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...
--
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,))
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 injection. Let the db
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 prepared statements, which can be a huge
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 has the same problem of creating a user after a
database, I'm sure that there is a user error in there somewhere
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 has the same problem of creating a user after a
database, I'm sure
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
Michele Simionato wrote:
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('CREATE TABLE example (date date)')
cu.execute(INSERT into example VALUES (%s
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 like
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
any type checking unless you are doing something odd, like I am, and
wanting
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
--
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('CREATE TABLE example (date date)')
cu.execute(INSERT into example VALUES (%s), (today,))
Traceback (most recent call
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's still the best library). Is there a
way to query the schema other than opening
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
way to query the schema other than opening a system pipe like psql
[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
'\d', psql -d '\d tablename', etc
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 tablename', etc.?
DBIAPI 2.0 shows
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
all time check for none, empty string and so on...
I've seen API of psycopg and some procedure for the solution but all are
too spaghetti for me.
I'm only with this problem ?
Glauco
. psycopg uses the pyformat one, where you just use %s as
placeholders.
It will happily quote all Python values of types int, str, date, float,
etc. for you. It's also possible to teach it how to quote other custom
data types, but you'll normally not need this.
HTH,
-- Gerhard
--
Gerhard Häring
among the various
DB-API modules. psycopg uses the pyformat one, where you just use %s as
placeholders.
It will happily quote all Python values of types int, str, date, float,
etc. for you. It's also possible to teach it how to quote other custom
data types, but you'll normally not need
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, you
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 local
network. For some reason
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
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
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
33 matches
Mail list logo