postgresql-9.6

SET client_min_messages to specific ROLE postgres

╄→гoц情女王★ 提交于 2020-04-17 19:01:11
问题 Hi Im trying to set the client_min_messages = error to a role using the postgres user, but when I login in the role I check current_setting('client_min_messages') and I get DEFAULT VALUE (notice). Ive already tried restarting config and also done some tests. To summarize I did: Login with postgres role. check default values of client_min_messages(notice) and log_min_messages(warning). ALTER ROLE anne SET client_min_messages = error; ALTER ROLE anne SET log_min_messages = panic; SELECT pg

SET client_min_messages to specific ROLE postgres

◇◆丶佛笑我妖孽 提交于 2020-04-17 19:00:23
问题 Hi Im trying to set the client_min_messages = error to a role using the postgres user, but when I login in the role I check current_setting('client_min_messages') and I get DEFAULT VALUE (notice). Ive already tried restarting config and also done some tests. To summarize I did: Login with postgres role. check default values of client_min_messages(notice) and log_min_messages(warning). ALTER ROLE anne SET client_min_messages = error; ALTER ROLE anne SET log_min_messages = panic; SELECT pg

how to add database in a new cluster in postgreSQL?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-25 10:20:31
问题 I am using sudo pg_createcluster -u=$USER --datadir=candisDatabase -l=candisDatabase/candis.psql.log 9.6 candisCluster to create a new database cluster with the specified directory as candisDatabase under the account $USER (which is 'rupav'). pg_lsclusters Ver Cluster Port Status Owner Data directory Log file 9.6 candisCluster2 5433 online rupav candisDatabase candisDatabase/candis.psql.log 9.6 main 5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log

Windows 10 PDOException with message 'could not find driver' Laravel 5.6.33 Wampserver 3.1.7 x86

本秂侑毒 提交于 2020-01-07 09:19:50
问题 I know there is a lot on this topic around StackOverflow, but my problem is that i have php extensions already uncommented, i have made the required changes to database.php and .env and i have declared and used the necessary environment path. The only thing i haven't done is install composer due to my proxy restrictions. I have a proxy that is over a kerberos windows AD, and for some reason nothing that used to work with proxy address, port and credentials (user and password) is working

PostGIS upgrade 2.2.1 -> 2.5.0 Database Import Errors

旧时模样 提交于 2020-01-04 14:18:32
问题 I'm moving a database from PostGIS 2.2.1 to 2.5.0 (PG 9.6). I pg_dumped the old database and am using pg_restore to import it. Everything appears to go fine but I'm getting these two errors. Is this something I need to worry about or can just ignore them? pg_restore: creating AGGREGATE "public.accum(geometry)" pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 4925; 1255 348862 AGGREGATE accum(geometry) aed pg_restore: [archiver (db)]

LIKE query on elements of flat jsonb array

自闭症网瘾萝莉.ら 提交于 2020-01-04 09:29:24
问题 I have a Postgres table posts with a column of type jsonb which is basically a flat array of tags. What i need to do is to somehow run a LIKE query on that tags column elements so that i can find a posts which has a tags beginning with some partial string. Is such thing possible in Postgres? I'm constantly finding super complex examples and no one is ever describing such basic and simple scenario. My current code works fine for checking if there are posts having specific tags: select * from

pg_upgrade with brew mac os 9.6.2 - 10.5

我只是一个虾纸丫 提交于 2019-12-25 00:36:07
问题 I've followed the excellent guide here to upgrade from 9.6.2 to 10.5 on mac os 10.11.6. When I get to the step 6 pg_upgrade -b /usr/local/Cellar/postgresql/9.6.2/bin/ \ -B /usr/local/Cellar/postgresql/10.5/bin/ \ -d /usr/local/Cellar/postgres.old/ \ -D /usr/local/Cellar/postgres.new/ I get this error check for "/usr/local/Cellar/postgresql/9.6.2/bin" failed: No such file or directory even though mv /usr/local/Cellar/postgresql/9.6.2 /usr/local/Cellar/postgres.old ran ok. However when I go to

PostgreSQL Upsert (On Conflict) with same values in Insert and Update

扶醉桌前 提交于 2019-12-23 16:28:13
问题 Can I simplify the syntax when I use the same values in an Insert... On Conflict statment? INSERT INTO cars (car_id, car_type, car_model) values (1, 'tesla', 'model s') ON CONFLICT (car_id) DO UPDATE SET car_type = 'tesla', car_model = 'model s'; There are many more statements of this kind because they are part of a script that gets run on every application update. Bascially I am looking for a way to not specify the same value twice. 回答1: Use the excluded keyword: INSERT INTO cars (car_id,

PostgreSQL: Encrypt Column With pgcrypto

有些话、适合烂在心里 提交于 2019-12-22 04:35:11
问题 I need to encrypt some columns in a PostgreSQL 9.6 database. The data being encrypted is inherently sensitive; however, the data are not passwords or other authentication credentials. This data will need to be decrypted for statistical analysis and consumption by users. After reading several questions and answers: Storing encrypted data in Postgres https://dba.stackexchange.com/questions/24370/how-to-use-aes-encryption-in-postgresql https://dba.stackexchange.com/questions/59942/secure

query.on is not a function

折月煮酒 提交于 2019-12-21 03:34:21
问题 I am trying to learn how to use javascript to connect to a postgresql database but when I try to log a query to the console using query.on(...), I get a type error that says "query.on is not a function". I have searched extensively on how to resolve this but can't seem to find any documentation on the .on function. I know that the connection is successful because when I query the db from terminal, the two new rows have been added. jsontest.js var pg = require('pg'); var conString = "postgres: