Tagged Questions
1
vote
2answers
40 views
Ruby on rails - wrong number of arguments (2 for 1) [Rails]
I've just change my database from sqlite3 to postgresql in my Ruby on rails.
Every things worked before but now I have a "wrong number of arguments (2 for 1)" when I submit the form. I don't ...
0
votes
1answer
27 views
sql query slow 3 leftjoins with where clausel
This first query have one and clausle more and slow down from 200ms to 9-13seconds
i dont get why its so.
If i remove all where clause i get ~200ms just if i add one more and it will be slow.
SELECT ...
-1
votes
0answers
18 views
database query result caching using memcache
i have a postgres based database and there is a table that has more than 5000 rows.
i need to display these rows in a page, but the way i am doing it now is i get all the 5000 rows all at once which ...
0
votes
0answers
12 views
How to view postgres on the hsql database manager
Mmm. I put the postgre jar on the lib folder of hsql database manager but then I tried to use the database manager an error occurs "java.lang.ClassNotFoundException:org.postgresql.Driver".
0
votes
0answers
12 views
how to create database postgresql on glassfish in netbeans
At first I need to create database in NetBeans and then create ConnectionPool in Amdin Panel of GlassFish. My problem that I can't create a new database postgresql in NetBeans. Maybe someone will ...
0
votes
1answer
15 views
How to rebuild database before testing using gradle?
I've my project with two subprojects and most of my tests depend on a database connection. As postgres is the target db I also want to use that in my junit tests. Before starting the testsuite (all ...
0
votes
2answers
27 views
Ruby on rails : Data base sqlite3 to PostgreSQL [RALS]
I'm converting my data base from sqlite3 to PostgreSQL in my rails project, so I follow this tutorial : https://devcenter.heroku.com/articles/sqlite3
I suceed to make all the needed changes but at ...
2
votes
3answers
60 views
Is it bad design to use arrays within a database?
So I'm making a database for a personal project just to get more than my feet wet with PostgreSQL and certain languages and applications that can use a PostgreSQL database.
I've come to the ...
0
votes
1answer
22 views
Data Import FROM Postgres SQL_ASCII database TO SQL Sevrer 2008 R2
I want to import data from a Postgres database to a SQL Server database.
The Postgres database is using SQL-ASCII encoding because the databse was migrate from old ISAM database.
So, if I want to ...
1
vote
0answers
29 views
unable to start Alfresco 3.4.4 (Error while starting postgresql)
I am using Alfresco 3.4.4 in my production environment(Redhat Linux). Yesterday I just tried to restart my Alfresco server but now it's not starting up. The tomcat starts successfully but postgres ...
0
votes
1answer
21 views
User based data access
Am trying to find the best way to implement a user based data access. For example, imagine that we have a company with a CEO and different department heads. A database contains the financials of each ...
1
vote
1answer
32 views
PostgreSQL prepared statement does not work
When I enter the following prepared statement:
PREPARE pstmt AS SELECT substring(indhold from $1 for $2) FROM mediefil WHERE id = $3
And execute it by entering the following command:
EXECUTE pstmt ...
0
votes
0answers
43 views
Can't change or turn off postgres logging
I'm trying to set the logging level in postgres to "error" or turn it off altogether.
Relevant parts of postgresql.conf:
log_min_error_statement = error
log_statement = 'none'
...
1
vote
2answers
37 views
How to do nickname searches in Postgres
Hi guys so I have a question about nick name searches.
I have a very large database and in my Accounts Entity I have a firstname column. When a user searches for an account by first name, it is ...
-2
votes
0answers
28 views
Best sql query builder for php and PostgreSQL with returning [on hold]
I'm looking for a SQL query builder for PHP that supports Postgres and it's the "RETURNING" statement.
I was using FluentPDO, but it seems that it doesn't support that (the documentation is not very ...
1
vote
1answer
36 views
Postgresql - Unwanted translation of newline characters
I have a problem I am hoping someone is able to help with...
In Postgresql I have a number of views that contain somewhere in them the following SQL:
select replace(
replace(details, E'\n\n', ...
1
vote
1answer
26 views
SQL Update with Subquery as Data source doesn´t work (Postgresql)
i have the following SQL DML Update command, but the syntax isn´t correct and the command doesn´t work:
UPDATE hmsg_vehicle_category
SET hmsg_vehicle_category.hmsg_id, ...
1
vote
3answers
53 views
Reverse index for multiple keywords search
I am looking for an architectural solution to the following problem:
General description of problem
I have lots of distinct data entities (approximately 15 millions). Every entity is associated with ...
0
votes
1answer
36 views
How to write this select statement?
If I have table1 contains Name, col2, col3 and table2 contains Name, NickName and col6.
I want to do select statement such I have a table like:
Name, NickName, col2, col3
where if table1 has 3 ...
0
votes
2answers
46 views
Multiple applications accessing the same data
So my team is developing an API in PHP .
My main concern is what happen 2 people call to update the same row.
So if one API call will do a read then process info then write, what happens if another ...
1
vote
5answers
86 views
Thoughts on using email addresses as primary key
What are practices about using email addresses as the primary key? Should I avoid it and use an auto incremented ID number instead or is the engine able to handle it just as well?
MySQL database but ...
0
votes
1answer
31 views
Database Initialization - Program Design
I have to initialize a DB(postgresql) and create the tables to use;
Which is the best way to do it in terms of program design?
In other words I have to create a static class, or a class and therefor ...
0
votes
1answer
31 views
SymmetricDS: real time synchronisation of MySQL with PostgreSQL
I need to move a huge system from MySQL to PostgreSQL. This cannot be done in one go, which is why I need a robust (real time or near real time) data bi-directional synchronisation solution between ...
1
vote
0answers
14 views
How to write an event trigger which send alerts to a JMS Queue
Is there any example where, we can trigger an event to send messages to JMS Queue when a table is updated/inserted ect for MYSQL/Postgre?
1
vote
2answers
74 views
Why does Drop Index require commit?
In my multi-threaded program, one thread drops indexes on a table (this happens first), and other threads insert records in the same table. It so happened that when dropping index is attempted, the ...
2
votes
0answers
31 views
Database Migration from Oracle to PostgreSQL [closed]
I am new in the PostgreSQL Database and I am trying my all database data, stored procedure, view, everything migrate in the PostgreSQL Database. I am many search in Google and try many available tools ...
3
votes
1answer
49 views
Restore deleted records in PostgreSQL
I accidentally deleted all the records from 3 tables in PostgreSQL. How can i restore the data?
0
votes
2answers
31 views
Node.js | insert into postgresql database results from api
I am quite newbie with node.js. What i am trying to achieve is the following:
Connect to my postgresql database and get info of three places (id, coordinates).
For each place obtained i need:
call a ...
1
vote
2answers
71 views
ERROR: syntax error at or near “select”
This code gave me an ERROR: syntax error at or near "select"
SELECT name_one, name_two, jaro(
select name from clients limit 50 as name_one,
select name from clients limit 50 as name_two
);
...
0
votes
2answers
29 views
Replicate some columns of table
I have a simple model in postgresql database and I want to replicate rows of this table in another database in another machine.
The replication should be for some columns of this table and not for ...
-1
votes
0answers
9 views
how to use OpenJPA to persist data to postgresql database using schema?
I have a rather simple OpenJPA application inserting data into a posgresql database. Now, the DB designer has decided to split the data into separate tables using schema;
CREATE TABLE Data ...
0
votes
2answers
56 views
Cayenne, Postgres: primary key generation
I'm using Cayenne 3.2M1 and Postgres 9.0.1 to create a database. Right now I'm having problems with the primary key generation of Cayenne since I have tables with more than one primary key and as far ...
1
vote
1answer
28 views
How to query a PostgreSQL database column whether an item apperas more than once
I want to know, how to get a value that is represented more than once in query.
The query:
SELECT
accumulation.partnumber,
municipality.bez_gem
FROM accumulation, municipality
WHERE ...
1
vote
1answer
23 views
Cannot generate a lot of unique strings
I've got a problem while trying to update a column with a unique string in PostgreSQL. I have a table with about 30kk records in it. What I want is to set a unique sha1 value to a specific column ...
0
votes
0answers
15 views
django & sql - how can I efficiently store and update sort order information associated with records in my database table?
So I have a Django app and one of the tables is basically a list of items. The user may choose to rearrange the order of this list. When they do this, I want to preserve this information so that the ...
0
votes
0answers
24 views
Design Tips For Database Structure That Takes Sharding Into Consideration [closed]
I am about to embark on a project that the size of the dataset will increase exponentially and sharding will be required. What are some good database design tips and difficulties should I take in ...
0
votes
0answers
30 views
Rails how to implement hierarchical associations
Is there a Rails way to implement hierarchical associations?
I'm currently trying to map below layout fields in database:
Product -> Product URL -> No Link
-> ...
1
vote
1answer
53 views
Postgresql fastest way of getting the set of unique values in one column or a large table
I have a constantly growing, potentially very large table in a Postgresql database that contains "data" from different "channels" for different "devices" eg.:
Table data:
id (PK)
device_id (FK ...
1
vote
1answer
18 views
How to prevent concurrent requests from sneaking by a check in Rails?
User has a balance of 1.
Two concurrent requests to make a transfer worth of 1 come in the following manner:
Transfer A passes validations as the user has enough balance
Transfer B passes ...
0
votes
2answers
45 views
How to store GPS tracking data in PostgreSQL database
I am currently developing GPS tracking program to track trips road, i have a mobile app in each car that sends GPS lat and longs each
period of time to store the trip road, i have lots of trips, each ...
1
vote
2answers
34 views
SQL Statement to UPDATE three characters in a string
How to take a string from a row in a column named 'link', and modify it by adding three letters to a specific index position in the string.
Specific example:
I want to select the value ...
1
vote
1answer
29 views
BLOB to Image conversion in PLPGSQL
I am new to PLPGSQL.
I am developing an application where the user will select an image and on submit plpgsql procedure will be called which will save the image on server.
Is there any way to ...
0
votes
1answer
48 views
Rake db:migrate and db:create not operated with proper database files
I know this question has come up on stackoverflow before, and I have tried the various solutions suggested, even trying to restart my current app. But none of them worked. I am trying to change my ...
1
vote
1answer
49 views
Query execution speed PostgreSQL 8.1 vs PostgreSQL 9.2
My question is general, but I've also aparticulr example to explain my problem. I developed a webapp with persistence layer based on Openjpa and used two databases to test it. One is Postgres 8.1 and ...
0
votes
4answers
50 views
Select ids that don't exist in a table
I have an ids range (it defines by startId and stopId). I have a table with some records(every record has an id - primaty key). Now I need to select all ids from specified range that don't exist in ...
0
votes
2answers
56 views
Missing FROM-clause entry for a table
I wrote the following SQL statement to get data from two tables gendata & TrainingMatrix:
SELECT * FROM (SELECT DISTINCT ON ("TrainingMatrix".payroll, "TrainingName", ...
0
votes
1answer
44 views
Combination of postgresql and neo4j for networking site
We are designing a networking site where data would be connected to each other in complex way.
We plan to use Neo4j so that we could escape costly join otherwise required. Since neo4j is specifically ...
2
votes
1answer
61 views
Getting error function to_date(timestamp without time zone, unknown) does not exist
Recently i have migrated my postgres from 8.2 to 8.4. when I run my application and tried to
login i am getting these error
ERROR [JDBCExceptionReporter] ERROR: function to_date(timestamp without ...
0
votes
1answer
38 views
Select of calculated value always returns row
I have a database (running on postgres 9.3) of bookings of resources. This database contains a table reservations which contains beside other values the start and stop time of the reservation (as ...
2
votes
1answer
45 views
Find the byte size of a row in PostgreSQL
Assuming I have a table in PostgreSQL, how can I find the exact byte size used by the system in order to save a specific row of my table?
For example, assume I have a table with a VARCHAR(1000000) ...