RE: Inserting record into postgresql database

2011-03-14 Thread Meszaros, Stacy
.plus.com] Sent: Friday, March 11, 2011 7:32 PM To: python-list@python.org Subject: Re: Inserting record into postgresql database On 11/03/2011 22:08, Meszaros, Stacy wrote: > Hello all, > > I am using python 2.6 and the psycopg2 module for the postgres connection > The following code i

Re: Inserting record into postgresql database

2011-03-11 Thread MRAB
On 11/03/2011 22:08, Meszaros, Stacy wrote: Hello all, I am using python 2.6 and the psycopg2 module for the postgres connection The following code is supposed to insert a record into a table with a bytea field. (bytearray) I am having difficulty getting to field inserted properly. The snippet

Inserting record into postgresql database

2011-03-11 Thread Meszaros, Stacy
Hello all, I am using python 2.6 and the psycopg2 module for the postgres connection The following code is supposed to insert a record into a table with a bytea field. (bytearray) I am having difficulty getting to field inserted properly. The snippet below inserts the first 8 bit hex value, whi

psycopg2 insertion and reading binary data to PostgreSQL database (bytea datatype)

2011-03-01 Thread romap
Hello. This is the full work version. Do yuo have: - Pyton, PostgreSQL, Psycopg2 - PostgreSQL dababase named "MyDATABASE" with table named "phonebook" - Table "phonebook" have this columns: "lastname" [TEXT datatype] and "c2image" [BYTEA datatype] - Do you have an jpeg file named "sun.jpg" on c:/

Re: Backup postgresql database from python

2010-12-04 Thread Philip Semanchuk
On Dec 4, 2010, at 2:32 PM, D'Arcy J.M. Cain wrote: > On Sat, 4 Dec 2010 19:12:08 + > starglider develop wrote: >> I need to backup a postgresql database from python withour using pg_dump! >> Is any way of doing that? > > Probably. I guess the first question

Re: Backup postgresql database from python

2010-12-04 Thread D'Arcy J.M. Cain
On Sat, 4 Dec 2010 19:12:08 + starglider develop wrote: > I need to backup a postgresql database from python withour using pg_dump! > Is any way of doing that? Probably. I guess the first question is why can't you use pg_dump? That might give us a clue as to the requirements.

Backup postgresql database from python

2010-12-04 Thread starglider develop
Hi, I need to backup a postgresql database from python withour using pg_dump! Is any way of doing that? Thank you in advance for your help. Zorze -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-23 Thread Graeme Glass
On Aug 23, 9:37 am, Julia Jacobson wrote: > How can I assign the result of a SQL query to a variable? > The following code snippet doesn't work: > query_result=cur.execute("SELECT column_name FROM table_name WHERE > my_variable = 'my_value'",) > >  > Thomas Jollans wrote: > > > > > * get the recor

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-23 Thread Peter Otten
Julia Jacobson wrote: > How can I assign the result of a SQL query to a variable? > The following code snippet doesn't work: > query_result=cur.execute("SELECT column_name FROM table_name WHERE > my_variable = 'my_value'",) To retrieve an image from a table "images" by its name you could do (unt

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-23 Thread Julia Jacobson
How can I assign the result of a SQL query to a variable? The following code snippet doesn't work: query_result=cur.execute("SELECT column_name FROM table_name WHERE my_variable = 'my_value'",) > Thomas Jollans wrote: * get the record you're interested in -- http://mail.python.org/mailman/li

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-22 Thread Thomas Jollans
g python, > >> > >> For the insertion of pictures into my PostgreSQL database [with table > >> foo created by SQL command "CREATE TABLE foo (bmp BYTEA)], I've written > >> the following script: > >> > >> #!/usr/bin/python > >

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-22 Thread Julia Jacobson
res into my PostgreSQL database [with table foo created by SQL command "CREATE TABLE foo (bmp BYTEA)], I've written the following script: #!/usr/bin/python import psycopg2 try: conn = psycopg2.connect("dbname='postgres' user='postgres' host='localhost

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-21 Thread Peter Otten
Julia Jacobson wrote: > Hello everybody out there using python, > > For the insertion of pictures into my PostgreSQL database [with table > foo created by SQL command "CREATE TABLE foo (bmp BYTEA)], I've written > the following script: > > #!/usr/bin/python >

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-21 Thread D'Arcy J.M. Cain
On Sat, 21 Aug 2010 22:58:00 +0200 Julia Jacobson wrote: > For the insertion of pictures into my PostgreSQL database [with table > foo created by SQL command "CREATE TABLE foo (bmp BYTEA)], I've written > the following script: > > #!/usr/bin/python > import

psycopg2 for insertion of binary data to PostgreSQL database

2010-08-21 Thread Julia Jacobson
Hello everybody out there using python, For the insertion of pictures into my PostgreSQL database [with table foo created by SQL command "CREATE TABLE foo (bmp BYTEA)], I've written the following script: #!/usr/bin/python import psycopg2 try: conn = psycopg2.connect("d

Moving Pickle data to Store in a Postgresql Database

2010-06-05 Thread Jaideep Khandelwal
Hi, I just need to know is there any existing module or library that could be used for storing pickle data fields into a Postgresql server database , I have found some answers to this about using with the SQlite3 for Python 2.5, but is it possible for Postgresql Server. ? Thanks Regards Jaideep

Re: Can't Write to PostGIS PostGreSQL database via psycopg2

2007-10-23 Thread David Michael Schruth,
On Oct 22, 8:43 pm, Erik Jones <[EMAIL PROTECTED]> wrote: > On Oct 22, 2007, at 8:19 PM, David Michael Schruth, wrote: > > > > > Hi, > > > I am sort of in a jam here. I am using the PsycoPG2 library to read > > data out of a windows XP based PostGIS / Post

Re: Can't Write to PostGIS PostGreSQL database via psycopg2

2007-10-22 Thread Erik Jones
On Oct 22, 2007, at 8:19 PM, David Michael Schruth, wrote: > Hi, > > I am sort of in a jam here. I am using the PsycoPG2 library to read > data out of a windows XP based PostGIS / PostGreSQL database but I am > apparently unable to write (update or insert) even though I am

Can't Write to PostGIS PostGreSQL database via psycopg2

2007-10-22 Thread David Michael Schruth,
Hi, I am sort of in a jam here. I am using the PsycoPG2 library to read data out of a windows XP based PostGIS / PostGreSQL database but I am apparently unable to write (update or insert) even though I am able to read (select) I am using PsycoPG2 2.0.6 (psycopg2-2.0.6.win32-py2.5-pg8.2.4

Re: backup/restore postgresql database

2007-08-02 Thread kyosohma
On Aug 2, 1:55 am, Acm <[EMAIL PROTECTED]> wrote: > I am working with Python 2.5 and Postgresql 8.2.4. > > I would like to know how to perform the backup and restore operations > on postgresql through a python API (e.g. psycopg2). > > Thank you. I don't know much about postgres, but here's what m

backup/restore postgresql database

2007-08-02 Thread Acm
I am working with Python 2.5 and Postgresql 8.2.4. I would like to know how to perform the backup and restore operations on postgresql through a python API (e.g. psycopg2). Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: postgresql database

2006-10-03 Thread Paolo
Michele Simionato ha scritto: > Paolo wrote: > > Ciao a tutti, sto cercando di implementare un applicazione che si > > interfaccia con postgresql(8.1), utilizzando Psycopg2, in ambiente > > windows (python versione 2.5). Ho installato Psycopg2 e provando > > solamente fare: import psycopg mi rito

Re: postgresql database

2006-10-02 Thread Michele Simionato
Paolo wrote: > Ciao a tutti, sto cercando di implementare un applicazione che si > interfaccia con postgresql(8.1), utilizzando Psycopg2, in ambiente > windows (python versione 2.5). Ho installato Psycopg2 e provando > solamente fare: import psycopg mi ritorna il seguente errore: > > import ps

postgresql database

2006-10-02 Thread Paolo
Ciao a tutti, sto cercando di implementare un applicazione che si interfaccia con postgresql(8.1), utilizzando Psycopg2, in ambiente windows (python versione 2.5). Ho installato Psycopg2 e provando solamente fare: import psycopg mi ritorna il seguente errore: import psycopg ImportError: No mod

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread SR
>> Say I have three tables. > > Only three? Well, yeah, OK, it's more than that, but after years of being worn away by "Post a minimal example" requests on comp.text.tex, a minimal example is what you got... > Something like {untested... Might need to do a subselect for the > sec

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread SR
Martin Christensen said: >SR> Scenario: I have a python script which creates web page listing >SR> all books in the database, and all authors for each book. My >SR> python script does essentially three things: > >SR> 1. retrieve a list of all book_ids and book_titles. > >SR> 2. for each book_id, q

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "SR" <[EMAIL PROTECTED]> wrote: >The script works fine, if a little slow. I think that's because if I >have 50 books in my database, my script performs 51 database queries (1 >for all book names; then 1 for each book) If your database is that small, why bother wit

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-10 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, SR <[EMAIL PROTECTED]> wrote: >As a starter project for learning Python/PostgreSQL, I am building a >Books database that stores information on the books on my bookshelf. > >Say I have three tables. > >Table "books" contains rows for book_id, title, subtitle, ISBN. >

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-08 Thread Martin Christensen
> "SR" == <[EMAIL PROTECTED]> writes: SR> Scenario: I have a python script which creates web page listing SR> all books in the database, and all authors for each book. My SR> python script does essentially three things: SR> 1. retrieve a list of all book_ids and book_titles. SR> 2. for each

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-08 Thread Frank Millman
SR wrote: > As a starter project for learning Python/PostgreSQL, I am building a > Books database that stores information on the books on my bookshelf. > > Say I have three tables. > > Table "books" contains rows for book_id, title, subtitle, ISBN. > > Table "authors" contains rows for author_id,

How can I reduce the number of queries to my PostgreSQL database?

2006-04-08 Thread SR
As a starter project for learning Python/PostgreSQL, I am building a Books database that stores information on the books on my bookshelf. Say I have three tables. Table "books" contains rows for book_id, title, subtitle, ISBN. Table "authors" contains rows for author_id, author surname, author f