PostgreSQL is an open-source, object-relational database management system (ORDBMS) available for all major platforms including Linux, UNIX, Windows and OS X. Please mention your exact version of Postgres when asking questions. Questions concerning administration or advanced features are best ...
0
votes
1answer
18 views
Vagrant port fowarding on macOS?
I'm running postgresql on a Vagrant centos 7.2 box on macOS. I have confirmed postgres is up and running on the Vagrant box on port 5432 by connecting to it using psql on the box itself. I am ...
0
votes
0answers
9 views
PSQL: find diff between 2 numbers in different rows
I have PSQL table writing every minute int value (requests count).
I have some requests types on some servers, all of them on the same table:
time | key1 | key2 | key3 | ...
0
votes
1answer
23 views
Django Heroku Postgres ProgrammingError: relation does not exist
I am struggling to get my Django 1.10 app deployed to Heroku. When I push this site to Heroku, I get the application error:
ProgrammingError at /homelibrary/
relation "catalog_book" does not exist
...
0
votes
0answers
7 views
Crystal Report formula error when accessed from VB.NET 2015CE
I have a Crystal Report I designed using a Function in my PostgreSQL database. The report's data source is the following SQL command (redacted):
SELECT * FROM [SCHEMANAME].[FUNCTIONNAME]({?[...
0
votes
0answers
5 views
How to perform full text search on PostgreSQL via Loopback?
I am using Loopback for my application — I need to perform a full text search on tables in the database. I've read the PostgreSQL documentation on text search but I'm not sure how to make these ...
2
votes
2answers
442 views
pgAdmin: Jobs option is invisible
I am using PostgreSQL version 9.3 for Operating system window 7.
I am getting problem to display the option jobs in postgresql PgAdmin III.
Here are the pictures what I have tried:
After setting ...
0
votes
0answers
10 views
Sum value and merge data when mapping data with duplicate product names
We're mapping data in order to quickly save an API dump to the database.
However, some of the items are listed twice so how would we add their value to each other?
For example, we're getting ...
1
vote
1answer
16 views
PostgreSQL Partition range - strange behaviour
I'm partitioning a table (t1) using an integer range using the check like this:
CONSTRAINT t1_201611_check CHECK (date_id >= 20161101 AND date_id <= 20161130)
CONSTRAINT t1_201612_check CHECK (...
2
votes
0answers
28 views
Integrity error: update or delete violates foreign key constraint. Django + PosrgeSQL
This my UserProfile modification
class UserProfile(models.Model):
user = models.OneToOneField(User)
fb_id = models.IntegerField(primary_key=True,null=False,blank=True)
...
0
votes
1answer
12 views
Users created, with different parameters in a single result, grouped by week
In Postgres, I am trying to find each weeks' statistics broken down for users. Not only would I want to know the number of users created, I would want to know the number of users created that didn't ...
0
votes
2answers
20 views
Extract date-by-date values also when no data
I have this table
records
- id
- date
- typology
I want to extract a day-by-day count of records with typology = 999. I know there's at least 1 record for each day, but most of days I don't have a ...
2
votes
1answer
39 views
Clustered index in PostgreSQL?
I have a table :
CREATE TABLE users (
id BIGSERIAL PRIMARY KEY,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
cell_id BIGINT
...
2
votes
1answer
14 views
A Postgresql function stuck in for loop, the query never ends querying
The function is stuck in for loop, the query remains querying and never ends:
ALTER TABLE movement ADD COLUMN bar_id INTEGER;
CREATE OR REPLACE FUNCTION get_all_movement() RETURNS SETOF movement AS
$...
2
votes
2answers
36 views
How to query for a list of associated records using Rails 4 + PostgreSQL?
I have the following models:
Question.rb
has_many :answers
end
class Answer.rb
belongs_to :question
end
What I want to do is get the most recent 10 Answers, and show a list of "Recently ...
-1
votes
0answers
30 views
postgresql - Subquery to look for random instance following a specific instance. Not working as part of master query
Just to clarify for moderation etc, this is a follow up from my previous post below:
postgresql - Subquery to look for random instance following a specific instance
That question was resolved ...
1
vote
1answer
27 views
How to sanitize or randomize sensitive database fields
What's the most efficient method or tool to randomize a list of database table columns to obscure sensitive information?
I have a Django application used by several clients, and I need to onboard ...
0
votes
0answers
7 views
Docker: skygear server not starting, connection refused
I followed the Docker manual on https://docs.skygear.io/server/guide/getting-started-docker.
I used Kitematic to download Skygear Server from SkygearIO.
When the server tries to start it can't connect ...
0
votes
0answers
5 views
i want to add jlabels on my frame dynamically and set their text according to entries in my postgresql database
i want to add jlabels on my frame dynamically and set their text according to entries in my postgresql database...the problem is that the labels are not being visible on frame...i m using netbans ide.....
0
votes
1answer
21 views
acces to file via UTL_FILE in postgresql [on hold]
what i am asking is to explain on how does "UTL_FILE" works on postgres..
Because i am trying to implement a write into a file without success..
Thanks
1
vote
0answers
12 views
PostgreSQL odbc_fdw issue creating foreign table, doesn't import two fields
I have been working with PostgreSQL again and i'm doing a communication between sql server 2005 and PostgreSQL 9.6. I used the Foreign Data Wrapper odbc_fdw.
I created with no problem like 11 foreign ...
3
votes
1answer
40 views
sequelize autoIncrement starting id for postgres
I'm in a situation where I want to have autoIncrement id keys on my models, but I also need to create fixtures and relationships between them. When I create fixtures, I manually specify ids (so that I ...
1
vote
1answer
13 views
Restore PostGreSQL materialized views
I'm unfortunately getting stuck on database stuff with PostGreSQL..
I created some materialized views in two schemas "schema1" and "schema2". These materialized views work well.
Then I made a backup ...
0
votes
0answers
6 views
Deploy BIRT Report on TomCat with Postgresql
I've a tomcat 8 instance with Birt Report installed on Ubuntu. With a very simple report (no database connection), I can generate my report online.
Now I would like to use my "real" report that use ...
0
votes
0answers
17 views
SqlAlchemy: How can SUBSTRING used in GROUP_BY (with PostgreSQL)?
I can get the all major version numbers with the next raw SQL query from the table which is stored the all published versions:
SELECT SUBSTRING(version FROM '6\.\d+|[7-9]\d*') AS major FROM ...
0
votes
1answer
15 views
SQLALchemy getting error when try to find and update atomically datetime fields
I need to update atomically one row
my code:
class TestModel(Base):
__tablename__ = 'table1'
id = Column(Integer, primary_key=True, autoincrement=True)
col1 = Column(String)
col2 = ...
0
votes
1answer
22 views
C++ Poco ODBC Transactions - AutoCommit mode
I am currently attempting to use transactions in my C++ app, but I have a problem with the ODBC's auto commit mode.
I am using the POCO libaries to create a connection to a PostgreSQL database on the ...
0
votes
0answers
41 views
Method Not being found even though it is there
I have a web application that is written using this stack: PostgreSql/Asp.net/Mono/C#.
I have a FormView on my .aspx page. I am using C# to fill and work with the FormView rather than a (...
1
vote
3answers
75 views
Query data from a PostgreSQL dump
I have a dump that was made from a PostgreSQL database. I want to check for some information in that dump, specifically checking if there are entries in a certain table with certain values in certain ...
1
vote
4answers
4k views
SQL: convert backup file from copy format to insert format
I have a PostgreSQL backup made with PHPPgadmin using Export > Copy (instead Copy > SQL which is actually what I need).
File contains entries like this:
COPY tablename(id, field) FROM stdin;
...
...
0
votes
1answer
73 views
How do I get pcp to automatically attach nodes to postgres pgpool?
I'm using postgres 9.4.9, pgpool 3.5.4 on centos 6.8.
I'm having a major hard time getting pgpool to automatically detect when nodes are up (it often detects the first node but rarely detects the ...
1
vote
1answer
12 views
Creating TEMP TABLE dynamically in Postgresql and selecting the same table in FOR loop. But getting the error near PIPE symbol
do
$xyz$
declare
y text;
i record;
begin
y := to_char(current_timestamp, 'YYYYMMDDHHMMSS');
raise notice '%',y;
execute 'CREATE TEMP TABLE someNewTable'
||y
||' AS select * from ( VALUES(0::int,-...
0
votes
0answers
18 views
how to define my database connection correctly in postgres with nodejs
var config = require('config.json');
var _ = require('lodash');
var jwt = require('jsonwebtoken');
var bcrypt = require('bcryptjs');
var Q = require('q');
var pg= require('pg');
var conString = "...
1
vote
2answers
52 views
How to specify UTC timezone for Spring Boot JPA Timestamp
Environment
Spring Boot Starter Data JPA 1.4.2
Eclipselink 2.5.0
Postgresql 9.4.1211.jre7
Problem
I am building a Spring Boot microservice that shares a Postgresql database with a different ...
1
vote
4answers
26 views
Postgresql: Query to know which fraction of the values are larger/smaller
I would like to query my database to know which fraction/percentage of the elements of a table are larger/smaller than a given value.
For instance, let's say I have a table shopping_list with the ...
0
votes
0answers
17 views
Is STABLE volatility safe for an idempotent data-modifying function?
I have a PL/pgSQL function which updates data (update_data). Within the context of a transaction this function can be considered idempotent, i.e. the function, if called with the same arguments within ...
0
votes
2answers
50 views
Find next birthdays to celebrate
I have an user model in my phoenixframework project with a birthday attribute which holds a Timex.Ecto.Date value.
defmodule MyProject.User do
use MyProject.Web, :model
schema "users" do
...
2
votes
1answer
31 views
Skip some ranges in postgresql sequence?
I want to skip some ranges in sequence:
Create sequence id_seq;
Consider I have a sequence as Id_seq.. And it starts from 100..
When it reaches to 199.. Then it should start with 1000 and when it ...
-1
votes
0answers
5 views
Is AgensGraph possible to support HA?
I have used PostgreSQL and ever heard that AgensGraph is based on PostgreSQL and Graph Database, so it is very robust, fully-featured and ready to enterprise use.
So, I wonder how AgensGraph supports ...
1
vote
0answers
22 views
Postgresql invalid input syntax with windows CSV files
For some reason Postgresql wont read my CSV files in the form:
2017-10-20T21:20:00,124.502,CAM[CR][LF]
2017-10-20T21:21:00,124.765,CAM[CR][LF]
(thats an ISO compliant timestamp right?) into a table ...
0
votes
1answer
10 views
Creating own distance api using postgres and own servey data
I am interested to create my own distance API to find out driving distance between two points on road. I don't want to use Google or graphhoper. Can some one suggest any PostgreSQL method or any open ...
0
votes
1answer
878 views
How to download bytea column as file using Java
I want to download files stored in bytea format using java. I don't have superuser privileges. Using the code below I download the hex encoded file and convert it to pdf but the converted pdf is ...
0
votes
1answer
25 views
Sequelize trying to query a dropped column
I've dropped a column from a model in my database using a sequelize migration and, even though the migration executes with success, sequelize is still trying to query the same field in my Node.js ...
0
votes
1answer
25 views
PostgreSQL perent with child list
I have a table structured as
Id int(10)
ROOT_ID int(10) --reference I'd
Name
This table contain structure of parants and sons. Example data
Id | parent | name
1 Null A
2 1 B
3 ...
0
votes
1answer
24 views
Rails - Optimizing DB Queries
I'm in the final stages of an MVP for a new pet project... and trying to improve the query times.
My primary table currently has about 150k records... and that's expected to grow to well over ...
3
votes
0answers
31 views
Conditional sum in the having clause of a grouped query with ActiveRecord
Given two postgres tables samples and sample_values
Table "public.samples"
Column | Type | Modifiers
------------+-----------------------------+----------...
0
votes
4answers
4k views
Hibernate exception : table is not mapped
I'm trying to connect to Postgres with hibernate however I'm getting exception that table is not mapped. Here is code:
hibernate.cfg.xml
<!DOCTYPE hibernate-configuration SYSTEM
"http://...
0
votes
3answers
34 views
Exporting bit data type data from SQL Server to PostgreSQL
I have table tbl_mak in SQL Server which contain's the following data:
Table:
CREATE TABLE tbl_mak
(
col_bit bit
);
insert into tbl_mak values(1);
insert into tbl_mak values(0);
After ...
0
votes
1answer
33 views
saving dates and data in rails with postgres
I am using postgres and rails. I have a hotel reservation marketplace app. I am trying to implement unavailable dates for rooms. So to get the unavailable dates from the host i provide a calender for ...
-1
votes
0answers
11 views
How can I Convert a shapefile to postgis table?
I have using postgres sql pgadmin3 and i need to create GEO Server PGIS Layer.
thats why i need to convert shapefile to postgres sql database table.
0
votes
2answers
18 views
Rails: Find model with less than X associations, also including the ones without any
I'm trying to make a way to group our users into segments.
User model:
Class User
has_many :orders
Order model:
Class Order
has_many :orders
Now let's say that I want to make a segment of users ...