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
1answer
12 views
First and last value aggregate functions in postgresql that work correctly with NULL values
I know there are aggregate functions for getting last and first value of rows in postgresql
My problem is, that they do not work as i need. And i could use the help of one postgresql wizard.
Query
...
1
vote
1answer
13 views
Postgresql change column type from int to UUID
I'd like to change the column type from an int to a uuid. I am using the following statement
ALTER TABLE tableA ALTER COLUMN colA SET DATA TYPE UUID;
But I get the error message
ERROR: column ...
0
votes
1answer
12 views
Importing CSV into Postgresql with duplicate values that are not duplicate rows
I am using Rails 4 and postgresql database and I have a question about entering in a CSV dataset into the database.
Date Advertiser Name Impressions Clicks CPM CPA CPC CTR
10/21/13 ...
1
vote
1answer
32 views
Efficiently counting strength of relationship between rows in Postgres
I have a table that looks similar to this:
session_id | sku
------------|-----
a | 1
a | 2
a | 3
a | 4
b | 2
b | 3
c | 3
...
1
vote
1answer
14 views
offset/limit performance optimization
I have a table with structure like :
Id (serial int) (index on this)
Post (text)
...
CreationDate (DateTime) (Desc index on this)
I need to implement pagination. My simple query looks like :
...
1
vote
1answer
8 views
Array for OR clause production Datatype Mismatch error
I have the following query
friends_ids = [1,2,3]
Friend.where("user_id = ? or friend_id = ?", friends_ids, friends_ids)
However, when I run it I get
PG::DatatypeMismatch: ERROR: argument of OR ...
1
vote
1answer
10 views
Are JPA (EclipseLink) custom types possible?
In particular I am interested in using PostgreSQLs json type.
The core of the problem seems to be that there is no internal mapping in Eclipselink to json type. So, using a naive approach with:
...
0
votes
1answer
18 views
postgres database setup for dev staging production enviroment
I'm deploying an App using PHP (CodeIgniter framework) and postgres (i'll probably use some javascript on the client side).
I'm using a Git repository with the dev-staging-production branches, and ...
0
votes
0answers
13 views
simplemembership does not found existing table
I have this mvc4 application about to implement a simplemembership. I want to cope my simplemebership to my existing table and I figured it out, works fine with the local sqlexpress server. But when I ...
2
votes
3answers
37 views
Regex failing to match number and dash with letter (or space and letter)
In the tester this works ... but not in PostgreSQL.
My data is like this -- usually a series of letters, followed by 2 numbers and a POSSIBLE '-' or 'space' with only ONE letter following. I am ...
1
vote
2answers
33 views
LOWER LIKE vs iLIKE
How does the performance of the following two query components compare?
LOWER LIKE
... LOWER(description) LIKE '%abcde%' ...
iLIKE
... description iLIKE '%abcde%' ...
1
vote
0answers
27 views
Save sql file without NULL values
When I run
pg_dump -O --column-inserts -U root map --file=
anything that has the value NULL is also printed.
Can I create an SQL file such that the columns which have NULL are not included?
...
0
votes
1answer
20 views
Whenever I run some kind of database operation (IE update_attributes, save, etc…), the timestamps are in UTC
When i run:
psql great_dev -c 'show timezone'
The following is returned:
TimeZone
------------
US/Eastern
(1 row)
I want the timezone to be EST, so I think that is correct. The problem is ...
0
votes
0answers
15 views
Data distribution for a system with SOA
I have a rails application which manages different types of items and users who own them. Items of different types might have different features. There is a number of sinatra services which have to ...
0
votes
0answers
25 views
JOIN query between Oracle and PostgreSQL [duplicate]
I have two database:
Oracle
PostgreSQL.
My application must use data from both of them.
In PostgreSQL I want to create a query containing several join with Oracle tables.
Any idea how to do ...