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.
1
vote
0answers
15 views
Array field not being recognized as attribute
I have the following model I created,
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :email
t.string ...
1
vote
1answer
12 views
Adding columns of two relations in postgresql
I have two relations such as relation1 and relation2. relation1 has columns of A,B,C and relation2 has columns of D,E,F.
I want to add A of relation1 with D of relation2 where C = F. For the C values ...
3
votes
3answers
20 views
How to use PostgreSQL upper() function with a different locale?
I have a PostgreSQL database on a shared host and the result of using the upper function is different in my local database because of the locale setting.
Here is what I want, and have in my local ...
1
vote
0answers
14 views
Greenplum database is not expanding dynamically to our Linux system
The main difficultly in this situation is a out of disk space error from the Greenplum database. We are running a Greenplum Database 4.2.0.0 on a Amazon Linux box.
The investigation has presented the ...
0
votes
0answers
10 views
China to AWS Multi-Master Replication
I am currently supporting a system that sits inside a data center in China, but has terrible performance outside of China due to the firewall. We are in the process of setting up a data center in ...
1
vote
2answers
25 views
Get order number that makes the total sum of orders be 1000
I have a table of Orders, and each row of those have a column called price. Each of those orders also has a column called created_at that will say when that order was created.
What would be a good ...
0
votes
2answers
36 views
PostgresSQL update query
I need to update table in my database. For sake of simplicity lets assume that table's name is tab and it has 2 columns: id (PRIMARY KEY, NOT NULL) and col (UNIQUE VARCHAR(300)). I need to update ...
0
votes
1answer
11 views
Import CSV table in PostgreSQL
I want import in PostgreSQL csv table with next structure:
1,qw,sdf,ty
2,efw,sd,hj,gh,hj
3,sfd,sd,gf,gh,h
4,fg,sd,dff
I use sql query:
CREATE TABLE test("nom" integer, "f1" text, "f2" text, "f3" ...
0
votes
0answers
6 views
Executing query in chunks on Greenplum
I am trying to creating a way to convert bulk date queries into incremental query. For example, if a query has where condition specified as
WHERE date > now()::date - interval '365 days' and date ...
0
votes
1answer
27 views
JOIN'ing by 3 tables and retrieving field based on content of those tables
Kind of hard to explain, so I'll map it out. Given these four tables: houses, landlord_houses, company and tenant, I need to find all the houses that have signed up in the last 14 days and get some ...
0
votes
1answer
11 views
DB Cleaner not cleaning database after each test after switching from sqlite to PostgreSQL
This config worked fine when I was using sqlite:
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
...
1
vote
1answer
11 views
How to get the timestamp by concatenating day and time database columns in postgreSQL
I am having day and time fields in database. I want to get the time-stamp by concatenating the day and time. How to this in postgreSQL.
I have done this.
SELECT EXTRACT(EPOCH FROM TIMESTAMP ...
1
vote
1answer
20 views
Issue connecting to postgresql using pdo on localhost (08006)
I have set up a test server and installed PHP 5.4 (zend Server with Nginx) and also postgresql 9.1.
I am trying to connect to the postgresql database using the following code:
define('DB_TYPE', ...
0
votes
1answer
24 views
Implementing visitors statistics for many users
I'm facing a challenge and I need your opinion, let me explain:
I have a database of around 300 000 users, which all have a profile page, and I would like to store the amounts of visitors that visit ...
0
votes
1answer
27 views
Tools for migrating database from sqlserver to postgres
I am looking for some good tools for migrating database. Migrating from sqlserver to postgres database.
Any Help :)