返回首页
We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [postgresql]

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 directed to dba.stackexchange.com.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

SELECT Top N Values Based on Category PostgreSQL

I have these table: test_result: test_id (int), user_id (int), score_test(int) user: user_id(int), age(int) I was asked to group the age from user, rank the score, and show the top 3 and ...
0
votes
0answers
5 views

Problems with running PostgresSQL together with node/express in Docker. FATAL: no PostgreSQL user name specified in startup packet

I'm trying to get a development enviroment running in docker. I have a docker compose file with 4 services: frontend, postgres, pgadmin4 and node/express. If i run postgres in docker and express ...
0
votes
0answers
4 views

Liquibase with Postgres, changelog parameters are not replaced

I'm using liquibase with oracle and postgres and I would like to use the changeLog properties to customize the elements of the changeSets that are different in the two databases. I'm using the ...
0
votes
0answers
7 views

Python3 subprocess create ssh tunnel and use for postgres dump

I am trying to set up a python script that connects to a remote server via ssh, sets up an ssh tunnel and uses this tunnel for a postgres database dump. I can use only the python standardlib, so I ...
0
votes
0answers
9 views

can not connect postgres in spring boot

I am beginer with java and Spring boot and when i build simple project to connect with postgres but it not work. here my struct of project: enter image description here here my XML file: <?xml ...
0
votes
0answers
12 views

Database Design in PostgreSQL

I am designing a database for a mock school. Requirements Professors have an SSN, a name, an age, gender, a rank, and a research specialty Professors work in exactly one department Departments have ...
0
votes
0answers
5 views

How do I convert a Julian date stored as a double-precision value to a timestamp with at least one-minute resolution?

I exported data from an SQLite table to a CSV file. The data includes a timestamp with at least one-minute resolution: "2019-11-15 01:30:06". The data is actually stored as a Julian date, in this ...
0
votes
0answers
6 views

why are there 2 libpq folders in PostgreSQL

In the PostgreSQL source code there are 2 libpq folders : src/interfaces/libpq src/backend/libpq what is the difference between them? As from what I have seen only the one present in interfaces ...
0
votes
0answers
9 views

Migration on 2 schemas

I have 2 schemas on my db: schema1 and public and I want to create some tables there . I tried code like this in my migration: return knex.schema .raw('CREATE SCHEMA IF NOT EXISTS schema1;') ...
0
votes
0answers
10 views

How to do I migrate from v10 to V11 on PostgreSQL using pg_upgrade on Windows?

I need some help on migrating from v10 to V11 on PostgreSQL using pg_upgrade on Windows machine? I am new to using PostgreSQL, and looking at the documentation, it is not helpful on using ...
0
votes
0answers
13 views

java hibernate one insert multiple values instead ofg multiple inserts

I saw multiple posts about this issue but there were many different answers. The issue: I have multiple entities that I want to insert as fast as possible. I'm using hibernate 5.3.5 and Postgres as ...
0
votes
2answers
27 views

SQL Update each row based on value from other

I need to do update, but for each row different value. I have sql like: select c.id as client_id, c.name as c_name, st.id as st_id, st.name as st_name, c.default_store_type_id from client c join ...
-1
votes
0answers
17 views

Is there a management software to create PostgreSQL database?

I am new to PostgreSQL databases. I have used and experience Microsoft SQL and MySQL. I have develop SQL databases with relation diagrams. Now I am going to develop a project which will use ...
0
votes
1answer
32 views

Golden Gate replication is extremely delayed

We are using Golden Gate in production to replicate from Oracle Database into the Postgres. Together with that, the Golden Gate replicates also into another instance of Oracle Database. Replicated ...
1
vote
1answer
17 views

Calculation in a table with a value from another table

Assumed we have two tables: Table A: a b c x 1 null x 2 null y 3 null Table B: a b x 5 y 10 I want to update Table A by multiplication of TableA.b with TableB.b and writing it into TableA.c. The ...
0
votes
0answers
21 views

cast string to date (string may empty spaces in the DD position)

I have a column with strings which look like this: '201201 ' '19880324' ' ' '176512 ' I need to cast them to date, but I cannot do it directly with to_date('string', 'YYYYMMDD') since some ...
0
votes
0answers
13 views

send a contact form to mail id and PostgreSQL database using Django

I would like to send a contactform to an emailid as well as save it to postgresql database.The following code helps me to send it to the mail id but can't save it in the database. can anyone please ...
1
vote
2answers
36 views

SELECT the most occuring value PostgreSQL

I have a table structure using postgres: tran_id (int), cust_id(int), movie(varchar(255)) Approximately the data is like this: tran_id cust_id movie ------- ------- -------- 1 ...
0
votes
2answers
23 views

PostgreSQL: migrating ms sql xml query to postgresql query

I am trying to migrate the following MS SQL Server procedure to a PostgreSQL function. CREATE PROCEDURE [dbo].[GMC] AS BEGIN DECLARE @LID VARCHAR(3); DECLARE @xml XML = '<...
0
votes
1answer
28 views

How can I assign a set of values randomly across the column in SQL?

I'm new to PostgreSQL and was trying to implement the following task. Given the column user_id in a PostgreSQL table, I wish to assign random values to the column hub_id in the same table. This hub_id ...
-1
votes
1answer
29 views

Unit test code := runtime error: invalid memory address or nil pointer dereference

I have created an API that is working fine, but I got an error like runtime error: invalid memory address or nil pointer dereference when the unit test code is executed. full response for your ...
0
votes
1answer
25 views

Postgress query, group by, and show the latest timestamp

I am making queries on a single table that contains a timestamp. My current query is the next one SELECT MAX (time) as MostRecentDate, name, country, tocurrency, fromcurrency, exchangeratebuy FROM ...
0
votes
2answers
19 views

Comparing two columns in Hibernate Criteria

I have a table in Postgre Database. The table has 2 timestamp format columns. I need those rows where one column timestamp is not equals the second column timestamp. For the below query I need the ...
-5
votes
0answers
23 views

i do drop database,then reload the page after few miniutes i get below the error

strong text[C3P0PooledConnectionPoolManager[identityToken->z8kfsxa6yudz04jdafnl|58c4a455, dataSourceName->czcwdvrg1574063711864]-HelperThread-#0] WARN c.m.v.resourcepool.BasicResourcePool - com....
0
votes
2answers
36 views

Why SQL Select Subquery behaves not as expected when all the tables involved are specified?

For the relation between the following tables: CREATE TABLE employees ( id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL ); CREATE TABLE tasks ( id INTEGER NOT NULL PRIMARY KEY, ...
0
votes
1answer
19 views

Why postgres forced sslmode=verify-full though it it not there in the connection string

I have removed sslmode=verify-full from the connection string still on running service it taking sslmode=verify-full. I have made ssl=true but removed sslmode. Is it in the valid connection string or ...
0
votes
2answers
32 views

PostgreSQL get yesterday by calling CURRENT_DATE

Running "SELECT CURRENT_DATE" in PostgreSQL returns yesterday in my case. Do you know a reason for this? There are alternative options like "LOCALTIMESTAMP". But i do not find something like "...
-3
votes
2answers
46 views

How to get column values as a table column in sql [on hold]

This is my table defined in the database: pi_value | Status ------------+------------------- 500.000 | Bank Submitted 500.0000 | Bank Submitted 1000.0000 | Maturity Received 4000.0000 | ...
0
votes
0answers
24 views

How can I run POSTGRESQL server on a public IP

I have installed PostgreSQL 11 on my Amazon Lightsail windows virtual machine. It is running on " http://127.0.0.1:59791/browser/" properly.But I want to run it on a public IP. How can I do it? Please ...
0
votes
0answers
24 views

Symfony Doctrine association top N by group

I'm trying to get top N by group of every association. Here I have 2 entities Task and Events. Events are asynchronously being added to db in intervals 30s to 2min (basically very often). There could ...
0
votes
1answer
35 views

When querying a postgresql database using Java, should I keep the connection open? [duplicate]

I'm connecting to a small PostgreSQL database on the local LAN using Java and running some queries and I'm not sure what is best practice. Should I close the connection after each query or keep the ...
1
vote
0answers
45 views

How do I convert a raw slice of bytes representing a PostgreSQL numeric column into a f64?

I'm querying an instance of PostgreSQL and selecting a sum of a decimal value: db=# SELECT SUM(distance) AS total_distance FROM table_name WHERE deleted_at IS NULL; total_distance ----------------...
0
votes
1answer
35 views

update value in list Postgres jsonb

I am trying to update json [{"id": "1", "name": "myconf", "icons": "small", "theme": "light", "textsize": "large"}, {"id": 2, "name": "myconf2", "theme": "dark"}, {"name": "firstconf", "theme": "...
-1
votes
2answers
28 views

Postgres Database in Dockerfile

I am trying to build a PostgreSQL image in DockerManually becuase I need to add some certain configuration for the database that doesnot exit in the postgres images provided with docker. I wrote the ...
0
votes
0answers
29 views

Indexes is created by itself in Postgresql

Could you help please. I'm a newbie in PostgreSQL. I use pgAdmin for management and I don't understand all of my tables have ~7-10 indexes, but I've not created them. E.g. in screenshot. If I try to ...
0
votes
1answer
20 views

Connect to created database with created user in a docker container

i’m trying to connect to a postgre database which is inside a docker container. I´m creating the docker container with following command: docker run --name prodcoc -p 5432:5432 -e POSTGRES_USER=...
1
vote
1answer
30 views

Postgres auto tuning

As we all know postgres performance highly depends on config params. Eg if I have ssd drive or more RAM I need to tell that postgres by changing relevant cfg param I wonder if there is any tool (for ...
0
votes
0answers
40 views

Speed up SUM Billion record on PostgreSQL

I want discuss about PostgreSQL database. I have almost 5 Billion record on table called "invoices" there store balance like this : id | account | type | amount | current_balance 1 A ...
0
votes
0answers
20 views

How to make “doctrine” to look in only one schema?

I have a Symfony 4.3 project with doctrine and PostgreSQL. There are several schemas in my database, but my project uses only 2 schemas. When I try to execute code that creates the table in the ...
0
votes
0answers
20 views

Any way to mimic coalesce in a unique index for a h2 database?

I am trying to create a unique index with two databases: postgres and h2. The unique index looks something like this: create unique index idx_unique on table(foo, bar, coalesce(unique, '')); ...
1
vote
1answer
32 views

Postgres wont use the proper index

I have the following table: id : id dim_id : fk day : date value : int With the following indexes: id : BTREE dim_id : BTREE dim_id, day : BTREE day, value ...
1
vote
1answer
21 views

SQL - Subtracting dates in two consecutive records, then finding the average

I've been stuck on this for such a long time. Let's say you have a table named Stays that shows the dates each person checked-in and checked-out of a specific hotel: +---------+------------+---------...
0
votes
1answer
26 views

How can I create laravel migration with enum type column?

I am trying to create enum column in laravel migration. Upon executing the query it does create column in the table but checking in postgresql for created enum types, it shows theres none. Does anyone ...
1
vote
0answers
17 views

Postgresql and libpq . Query getting dropped from randrom number of child processes

I have forked 4 client process from parent. For testing purpose, i execute an sql query in the child process when i receive valid input. My debug show that i received the valid string in all the ...
-2
votes
1answer
30 views

SQL get one row for each table_number filtered by lastest date

I want to get one row for each table_number filtered by lastest date. And if possible how can I do it with JPA ,I am using spring boot. order_table_id date is_done is_started ...
0
votes
0answers
15 views

Sequelize v5 - group by with nested includes

The query I want to optimize uses the following tables : My current ( working but not optimized ) query looks like this in the Exercise model ( stored as a scope ) ...
0
votes
1answer
21 views

Structuring a hasura-graphql insert mutation query for an object with a one-to-many foreign key relationship

I'm having trouble building a hasura graphql query that inserts a row into a table that has multiple foreign key relationships. I have three tables, "Users", "Groups", and "UserGroups". The "...
0
votes
0answers
16 views

Postgres denies permission for relation migrations in Laravel

If I try running the following query, it doesn't work only for the Laravel migrations table even if I am running it with the master RDS super user: GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public ...
0
votes
0answers
31 views

PostgreSQL Store-and-Forrward

I'm building a data collection RESTful API 0 External devices will post json data to database server. So, my idea is to make it by Store-and-Forward ideology. At the moment of the post, it will store ...
0
votes
0answers
15 views

handling inherited sequence ids

I had the following tables: supernode (id bigint, name text) and subnode(id bigint, parent bigint references supernode(id), name text). (massive simplification to illustrate the issue, obviously) But ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞