PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions.
0
votes
0answers
7 views
Postgreslq Explain analyse : hidden time
I've a long query and explain analyze isn't helping.
The current plan:
Hash Cond: (cte_dwh.rfoperdtd = dwhinv.dwhinvdtd)"
-> Group (cost=20000003814.32..20000004408.92 ...
1
vote
1answer
13 views
Rails multitenant architecture, migrating from single-tenancy
We have a single-tenant database architecture at the moment with MySQL running upward of 100 databases. We switch database connection on subdomain using the Apartment gem and all is dandy!
However, ...
0
votes
2answers
33 views
SQL joined by last date
This is a question asked here before more than once, however I couldn't find what I was looking for. I am looking for join two tables, where the joined table is set by the last register ordered by ...
0
votes
2answers
17 views
Read data from other postgres database
I have a Rails app A with a postgres database. I also have another Rails app B with a postgres database. Now I want to reuse some of the data of app B in app A. What is the best way to import that ...
0
votes
2answers
23 views
How to map a postgres money column in MS Access?
I have a postgresql database. In some tables there are columns of type money.
I'd like to use MS Access as a front-end.
But while linking the table in MS Access using postgres odbc driver, the ...
0
votes
0answers
6 views
Field default timestamp set to table creation time instead of row creation time
Using SQLAlchemy, alembic and postgres, when trying to set a column to the row creation time what I finally get is a field that defaults to the time when the table itself was created, instead of the ...
0
votes
1answer
12 views
PostGIS spatial reference ID (SRID) for regular cartesian coordinate system?
I would like to store a polygon as a set of 2D points represented as x, y coordinates of a Cartesian coordinate system.
Which spatial reference can I use? Looking at my spatial_ref_sys table, all the ...
0
votes
1answer
8 views
Is there a good tutorial(windows) for using openstreetmap planet.osm hourly/diff to update local postgres/postgis database?
The purpose of this app is to get user statistics (like no. of ways 'amenity=school' created by a user).
Previously I tried changesetsGet and changesetDownload form osm api v0.6 for query. It took ...
0
votes
1answer
16 views
Connecting Postgres ODBC to SQL Server Reporting Services/Data Tools/Report Builder
I've been using Crystal Report for my Adempiere (ERP Software which i believe use Postgres ODBC)
I want to try SSRS cause i've heard some good things about it. At this point i just want to try the ...
0
votes
2answers
20 views
Retrieve Timestamps between in postgresql
select
to_timestamp('2013-06-24 11:36:40 AM', 'yyyy-MM-dd hh:mi:ss a') >=
to_timestamp('2013-06-24 11:20:00 AM', 'yyyy-MM-dd hh:mi:ss a')
and
to_timestamp('2013-06-24 11:36:40 AM', ...
0
votes
6answers
61 views
How do I select 1 column from a SQL query which is ordered by date?
So I have a private messages model which has the columns: sender_id, recipient_id, content, and created_at.
I want to select the last 5 recipients I have messaged. However, I can't figure out how to ...
1
vote
1answer
23 views
How do I do an UPSERT (MERGE, INSERT … ON DUPLICATE UPDATE) in PostgreSQL?
A very frequently asked question here is how to do an upsert, which is what MySQL causes INSERT ... ON DUPLICATE UPDATE and the standard supports as part of the MERGE operation.
Given that PostgreSQL ...
0
votes
1answer
16 views
Generate values from db enum for jpa enum at runtime
I have seen on the internet ways to map a postgresql enum to a java enum. But all the methods i have seen do not fare well when i modify the enum in the DB. What i would want to do is create the java ...
0
votes
1answer
21 views
Syntax error when adding Postgres constraint
I'm running Postgres 8.4.13, and trying to add a constraint to an existing table. According to the docs, this should be possible:
alter table indexed_friends add constraint no_duplicate_user_friends ...
2
votes
2answers
30 views
Measure query execution time excluding start-up cost in postgres
I want to measure the total time taken by postgres to execute my query excluding the start-up cost. Earlier I was using \timing but now I found \timing includes start-up cost.
I also tried: "explain ...