Tagged Questions
0
votes
0answers
9 views
python/posgres/tryton/ Cant Update a record
i have this line of code that im using and im having a problem with it.
query = "UPDATE upr_pr SET refnum = %s WHERE id =%s" %(self.acctno,dbid)
now if self.acctno contains an interger it updates ...
3
votes
1answer
25 views
postgres plpy.execute with hstore string literal FAIL
Hi I'm writing a plpython function using postgresql 9.2. Assume the code has already executed a query that returns hstore strings. I wish to then issue a query: "SELECT ...
0
votes
1answer
55 views
Can we calculate Net Salary with openERp
In our company we decided to use openERP
We now working to customize openERP with our work ... we can use it successfully in warehouse dept. and sallies dept.
My question is how to make openERP ...
0
votes
2answers
23 views
Load PostgreSQL database with data from a NetCDF file
I have a netCDF file with eight variables. (sorry, can“t share the actual file)
Each variable have two dimensions, time and station. Time is about 14 steps and station is currently 38000 different ...
1
vote
1answer
34 views
Can I generate schema migrations from South that work on different databases [sqlite and postgresql]?
I use sqlite3 on my dev server and when I change the schema, I'd like to be able to generate migrations on development that I can use on production, which uses postgresql. One option would be to ...
0
votes
1answer
36 views
How to create a migration after adding an hstore field? (django-hstore vs. South)
I have an existing model in the database. I want to enhance it with an hstore field. I installed hstore Postgres extension, django-hstore app, changed the appropriate settings in the django project:
...
0
votes
2answers
51 views
Django tries to add a null value in id (primary key) field
I created my models and everything was running smooth, but I had to create another field, so I created it and added it in the model definition. After that (I'm not 100% it was that the cause) Django's ...
1
vote
0answers
49 views
Matching string across multiple regular expressions
I have a postgresql database with table that contains about 50 million entries of strings that are addresses. Example of strings are
NIAID, Opportunist Infect Res Branch, Treatment Res Programs, Div ...
1
vote
1answer
15 views
How to specify the PostgreSQL DateStyle property with SQLAlchemy ORM
PostgreSQL supports specifying Date Formats using the DateStyle Property as mentioned here,
http://www.postgresql.org/docs/current/interactive/runtime-config-client.html#GUC-DATESTYLE. (link was ...
3
votes
2answers
62 views
“Correct” way to store postgres password in python website
I'm writing a web application in Python (on Apache server on a Linux system) that needs to connect to a Postgres database. It therefore needs a valid password for the database server. It seems rather ...
1
vote
2answers
42 views
Difference between Python and Postgres locale currency formats
Python 2.6:
import locale
locale.setlocale(locale.LC_MONETARY, 'fr_CA.UTF-8')
locale.currency(1.234) # '1,23 $'
Postgres 9.1:
set lc_monetary = 'fr_CA.UTF-8';
select 1.234::money; -- '$1,23'
I ...
0
votes
1answer
96 views
Delete all data in all tables older than period using date column
I have a set of tables, which all have a date column (timestamp without time zone) equal to time inserted.
How would I go about deleting all data in all tables older than 24 hours using the date ...
3
votes
1answer
53 views
Problems with group_by statement, sqlalchemy and postgresql
I have a problem with the following query; This, itself, works fine, but it groups by second, I want to truncate seconds and group by minute. I have experimented with date_trunc, extract and so on, ...
2
votes
0answers
44 views
Is there a Python MySQL API that returns Prepared Statements for re-use?
Neither MySQLdb nor oursql allow returning prepared statements to be filled by parameters for successive executions. Are there any others?
At least for .executemany() oursql seems to be more ...
0
votes
1answer
38 views
How do you create a table with Sqlalchemy within a transaction in Postgres?
I'm using Sqlalchemy in a multitenant Flask application and need to create tables on the fly when a new tenant is added. I've been using Table.create to create individual tables within a new Postgres ...