Category "postgresql"

PostgreSQL: Show all the privileges for a concrete user

How to make a query to the Postgres data dictionary to find out all the privileges that a particular user has. I've been looking for a solution and I can not f

How to write DataFrame to postgres table

There is DataFrame.to_sql method, but it works only for mysql, sqlite and oracle databases. I cant pass to this method postgres connection or sqlalchemy engine.

Getting a nullpointerexception for my EntityManager

Working with Wildfly 10 on the following: a JSON webservice accessing a postgresql db using hibernate through a DAO object. More specifically, my POJO User.jav

Display select results vertically in psql, as is done by MySQL's \G

In MySQL, you can terminate a select query with \G (as opposed to \g) to display the results vertically: select * from foo \G *************** id: 1 bar: Hell

ERROR Relation already exists in PostgreSQL when creating an index on a table

I have an error when running the the queries below on PostgreSQL from a Java code ..... sql = "CREATE TABLE IF NOT EXISTS table1 (s VARCHAR(100), p VARCHAR(

How can I mock nest typeorm database module in end to end (e2e) tests?

all. Include details about your goal: I'm trying to mock repository in e2e test Describe expected and actual results: Request to server will not have access

postgresql: INSERT INTO ... (SELECT * ...)

I'm not sure if its standard SQL: INSERT INTO tblA (SELECT id, time FROM tblB WHERE time > 1000) What I'm looking for is: what if tblA and

Postgres: Install a specific version of plv8

I'm installing plv8 in docker: FROM postgres:13 AS build ENV PLV8_VERSION=v3.0.0 RUN apt-get update && apt-get upgrade \ && apt-get instal

Syncing PouchDB offline to PostgreSQL

I am trying to make my web application work on offline mode by using pouchDB. but the backend database server i used is PostgreSQL (NoSQL). I couldn't find a wa

Can PostgreSQL array be optimized for join?

I see that PostgreSQL array is good for performance if the array's element is the data itself, e.g., tag http://shon.github.io/2015/12/21/postgres_array_perform

What is the purpose of views' predefinitions in dump file

I'm working on the project where we are using :sql schema format for the Active Record dumper (to support more complex logic like triggers). We have a lot of

How can I run an ad-hoc script in PostgreSQL?

I'm trying to run this in PostgreSQL 9.2: RAISE NOTICE 'Hello, World!'; And the server says: Error : ERROR: syntax error at or near "RAISE" LINE 1: RAISE NOTI

Nearest location from JSON column

We have a directory application and every directory has many branches and many location points (latitude, longitude) The branches location are stored in the dat

postgresql duplicate key violates unique constraint

I have a question I know this was posted many times but I didn't find an answer to my problem. The problem is that I have a table and a column "id" I want it to

Backend docker image does not wait until db becomes available

I am trying to docker-compose up my containers, one for backend and another one for the database (postgis). If I docker-compose up db, I see db_1 | 2021-11-23

Query returns function plus the value inside instead of just the value

I'm running a select query and for fetching date and time data from the database but for some reason the returned value is datetime.date(2021, 11, 18) and datet

Check the perm 'Create Database' in PostgreSQL as well as in SQL Server

I would like to check the perm in PostgreSQL db as well as I do it via this command 'SELECT HAS_PERMS_BY_NAME(NULL, 'DATABASE', 'CREATE DATABASE')' for the SQL

Will TypeORM @AfterRemove or @BeforeRemove entity listeners still run when the db is dropped?

Some entities in my database have a property which is their associated key on AWS S3, for example: // my.entity.ts @Column() s3Key: string; I would like one of

recursive tree as a list (array items) in a new attribute value child

How to get hierarchy data(recursive tree) as a new column like below? (if there is last child then column child array is empty) rows: [{ 'id' : 1, 'paren

Printing to the screen in a .sql file in PostgreSQL

I have a .sql file I am building for an upgrade to my application that alters tables, inserts/updates, etc. I want to write to the screen after every command fi