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.
I've got this test database that I want to use for validating a phone numbers.
However it currently only works with a single number at a time.
I'm setting up a PostgreSQL database for my golang backend, but I'm getting this error when trying to read a table:
runtime error: invalid memory address or nil pointer dereference
I am beginning to build out the user authentication part of my application and I am using PostgreSQL as my database. I have a table set up in PG with the following code. This is the code I used to set-...
I have a database where one user has multiple submission and one submission has multiple post
I would like to find all users who have made posts with the tag "car" and posts with the tag "bike".
On my Google App Engine I've depoloyed a Ruby on Rails project and connected it to postgresql. Application seems to be properly connected and everything works fine. However when I want to get access ...
i want to save date & time & time zone of user when he signup.
i have a 'signup_date' column in account table that its type in java is 'OffsetDateTime' and in liquibase is 'Datetime' and in ...
I am running postgresql 11. I have set the locale to be zh_CN.UTF-8 because I need to query zh_CN text. But the weird part is I just want it for query, but not the whole system. Right now, all psql ...
I have created a Android Mobile app for pushing some data in my database. Now before pushing the data I want the user to login through the credentials he use to login in odoo. I can get the email/...
I would like to have some advise on how to handle an error in case of my database server is disconnected.
Let's say I have 2 server running:
Using postman to test my endpoint, I create ...
I'm trying to convert the output of a SELECT of a MAC address in a Postgres database from for example: ab12cd34ef56 to AB:12:CD:34:EF:56 and I haven't been able to find a Postgres function or Regex ...
I have 3 schemas: Post, Author, Assistant.
Post belongs_to :author
Author has_many :posts and has_one :assistant
Assistant belongs_to :author
I want to build a query that only gets Posts where the ...
I have a Jenkins job that does the following -
1) SSH into a server
2) Run a psql script
The script runs for 4 hours when I run it manually, but every time I run it from Jenkins it stops at 1 hr ...
I'm looking for a simple method to determine if an integer is to the right or the left of a range.
The << or >> range operators would be perfect but they only appear to work range to range. Is ...
I have a table with a column named priority. I created a trigger function that fires after update. I want the function to change the values of the rest of the rows' priority column. For example I ...
I want to insert into table from select statement but it is required that insert only happens when select returns valid rows. If no rows return from select, then no insertion happens.
insert into ...
I successfully deployed my website on Linode on a Ubuntu server.
I am using Postgres for database.
I can perform all the actions correctly.
However, I would like to clean my database (deleting all ...
I've got an application running a Postgres db. It sees medium usage--at most it gets about 3-4 RPS, but usually much less.
Recently timeout errors have been popping up, which appear to be caused by ...
I'm using Django and Python 3.7. How do I scan for words in a Django query? A word is a string surrounded by whitespace (or the beginning or end of a line). I have this ...
I have a query that I'm attempting to optimize and running into some unexpected behavior.
For example, take a table like this:
CREATE TABLE objects
(id int, external_id int, timestamp timestamp);...
I am currently planning on using an AWS ECS task (or maybe a lambda function) to perform a SQL COPY command against a Postgres database to send a CSV file to the ECS instance running the task and then ...
When I try to save a dataframe in Postgres using pyspark on EMR I get the following error:
org.postgresql.util.PSQLException: The connection attempt failed.
However the table is created, but ...
I am unable to establish a DB connection between Navicat Essentials and AWS RDS PostgreSQL.
I haven't had any problems or issues in the past so it just stopped working out of the blue.
How can I move the array bigint value from one index to another? For example, I have an array ARRAY[1, 2, 3, 4] of bigint unique values and want to move value 1 to index 3 so the final result would be ...
I have a table of sales grouped by week. I want to write a query that creates a new table giving the sales of the week in question AND the sales of that item from this time last year, but my attempts ...
I am trying to move data from a oracle instance to postgres RDS using DMS. I am only doing a full load operation and I have disabled all the foreign keys on the target. I also made sure that the ...
I have an alert table which is transactional and an alert type table which is master. I would like to send out an email whenever an alert is added to the table, so I figured I would use PrePersist. ...
I have the following tables:
I'm unable to Connect with Postgresql Database on DigitalOcean Server. I am getting this
Call to Undefined function pg_connect..."
error message when I tried to test with postman tool.
My PHP ...
I'm trying to create a nested json from a table like this:
| unixtime | assetid | data |
I am trying to compile an SQR report using PostgreSQL. Here is my command line for Oracle:
C:\hyperion\SQR\bin\SQR\Server\Oracle\bin\sqr.exe LogAsRun.sqr ads/[email protected]
-RS -M sqrsize.dat
What would ...
I don't know where to put the semicolons in the following structure. I've tried writing the semicolons after both 'with as' as per my interpretation of the docs but that's not right:
CREATE OR ...
I have a table from OSM with a column titled way which has values that appear to be HEXWEKB coded geometry(LineString, 3857) (I'm looking at the column type via pgAdmin).
I'm trying to understand how ...
So I have the following table with the schema:
CREATE TABLE stages (
id serial PRIMARY KEY,
cid VARCHAR(6) NOT NULL,
stage varchar(30) NOT null,
status varchar(30) not null,
with the ...
I'm quite new to pgpsql. I have two tables - product and product_category - with a one to many relationship. I'm creating a procedure to insert a value into the category table if it doesn't exist and ...
I have a query which gives me all numeric columns in my Postgres database:
SELECT table_schema, table_name, column_name
WHERE table_schema in (
i have no idea what data is in the field img bytea.. because this data comes from the previous developer using delphi language i just want to display it in my php code
I tried to use ...
So I have sql statements as follows:
var sql = `SELECT
So I got this table on postgresql that people regularly update and the below function.
What this function is supposed to do is to fill ...
I have multiple .sql files on my local machine, which I was executing rapidly with one command
psql .....-f abc.sql (containing \i def.sql; \i ghi.sql) on db server hosted on aws.
Now, I have ...
I have a table id parent_id Name
I want leaf children at each level.
I have these query:
from runinfo a left JOIN definition b
There are two tables with names "table_A" and "table_B".
table_A contains records of documents.
table_B constains records of transactions.
When creating a new document, a new record is created in ...
While doing Declaring Mapping
Base = sqlalchemy.ext.declarative.declarative_base()
__tablename__ = '...
I have the below query, I am trying to get all points that are within 100m of each, the query generally works ok, but it will return 'duplicates'. (the table location_signals is a table that contains ...
I have an issue with records in plpgsql.
I tried to return a set of record like this. But postgres doesn't want it and raise me en error so how can I do that ?
Error is something like I cannot ...
I have the following table
| ID | Seq No|
| 1 | 12345 |
| 2 | 12345 |
| 3 | 12345 |
| 4 | 12345 |
| 5 | 12345 |
Both the columns are primary key values.
Here I need to ...
I have made a database on pgAdmin 4 but values are not updated when sent through signup form on node.also npm install postgre-sql giving an error
var express = require('express');
Suppose I have a table with two columns:
| id | status |
Status can take 3 values: booked, started, completed
I need a constraint that will satisfy the following requirement:
For entire set of ...
I save pandas dataframe to postgres db table using to_sql(). If one of rows is of incorrect format, psycopg2.DataError is raised and whole dataframe does not get saved. I tried to catch the error and ...
As we see, users 1,2,3 all have products 4 and 5. So how ...