PostgreSQL is an open-source, Relational Database Management System (RDBMS) available for many platforms including Linux, UNIX, MS Windows and Mac OS X. Please mention your PostgreSQL version when asking questions.
1
vote
0answers
42 views
Faster way to update/create of a large amount of records?
In our Rails 3.2.13 app (Ruby 2.0.0 + Postgres on Heroku), we are often retreiving a large amount of Order data from an API, and then we need to update or create each order in our database, as well as ...
0
votes
0answers
10 views
Rails / Ruby: Importing Markdown Files - Code Efficiency?
I'm building a rails app that, among other things, imports text markdown files as blog posts. The idea is that the truth is in the markdown files, so any time those are edited, created, or deleted, ...
0
votes
0answers
26 views
Optimize postgres function
This function code works very slowly. How can I speed it up?
CREATE OR REPLACE FUNCTION bill."ReportIngredients"(
_from date,
_to date,
_beginning_date date,
_has_inventory boolean,
...
1
vote
1answer
40 views
Postgres 9.x Joining on Overlaping Date & Time Range
I have several tables that have a TIMESTAMP WITH TIME ZONE column along with some additional information. I need to be able to join these tables such that all of the information on each row is "valid" ...
1
vote
1answer
38 views
Summing different tables values limiting the results
I have two tables (a and b) which have both one date field of type TIMESTAMP. They represent two different type of actions (records): table a's actions are $200 worth each, while table b's ones worth ...
1
vote
2answers
123 views
First Database Schema - How did I do?
I would really like some advice from any DB gurus who have a few minutes free. After doing some reading and playing with sqlfiddle over the weekend I have constructed this postgresql schema and it is ...
3
votes
2answers
166 views
PostgreSQL simple query with repeated function calls
I have PostgreSQL 9.1.1 running in a shared hosting environment and I'm running this query:
SELECT a.id,
CASE WHEN a.idpai IS NULL THEN a.nome
ELSE concat(a.nome, ' (', b.nome, ')')
END AS nome, ...
1
vote
2answers
111 views
simplify and improve performance of getting data
I am working on a little browsergame project written in PHP and using PostgreSQL as DBMS. Now I'm not really lucky with the process started after a userlogin was succesful.
Some info:
there are 3 ...
2
votes
0answers
44 views
Low performance of PL/pgSQL function
I have a PL/pgSQL function which is unstable. This is source:
DECLARE
l RECORD;
events_for_machine integer;
before_event "PRD".events_log;
machines_ids integer[];
island_controller RECORD;
...
8
votes
1answer
2k views
Node.js password salting/hashing
In view of the recent LinkedIn breach, would anyone care to review my data access routines relating to user access?
This is a standard node.js module, accessing a Postgres database.
(function () {
...
6
votes
2answers
700 views
SQL: Search for a keyword in several columns of a table
I want to perform a search in several columns of a table. I use the following query:
select *
from Tabela t
inner join "TabelaPai" tp on tp."ID" = t."RefTabelaPai" and tp."RefProject" = 'projectid'
...
6
votes
2answers
701 views
SQL: Extracting nodes from a graph database
I guess I'm one of these people who are more at home in C#,C++, Python, etc; and only use SQL to do simple INSERTs and SELECTs, so apologies if this is too simple. I'm also new to Postgres and ...