postgresql

How can I fix the error with json_object in postgresql-9.6?

爷,独闯天下 提交于 2021-02-11 14:21:40
问题 There is Zabbix with PostgreSQL database monitoring. There is one trigger in Zabbix that constantly spam error: ERROR: function json_object(text[], text[]) does not exist LINE 11: SELECT json_object(array_agg(name), array_agg(setting)) F... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. SQL state: 42883 Character: 190 Found a template in which this trigger is registered. It is standard, I tried to request a line separately in Postgres

How to “reset” a postgres database on PythonAnywhere?

ⅰ亾dé卋堺 提交于 2021-02-11 14:16:17
问题 After some testing with Django on PythonAnywhere, I want to get rid of my testing data before I import my actual data to the postgres database. I thought the best way would be to start from scratch and "reset" somehow the database. Unfortunately there is no button for that on pythonanywhere.com and the documentation does not say anything. So the question is: how can I "reset" or empty the postgres database on PythonAnywhere? 回答1: With the help of the PythonAnywhere support I found a way which

Why PostgreSQL need script for Execute and not need script for query_to_xml?

大憨熊 提交于 2021-02-11 14:10:46
问题 I am new to PostgreSQL. I have a doubt about PostgreSQL script . In my last question i was trying to use "execute" . Then i come to know , If i want to use Execute in query i have to make script (use $$ LANGUAGE ... ). But one answer from similar questions , use query_to_xml and it not need script . why ? 回答1: Unlike SQL Server, Postgres (and many other DBMS like Oracle, DB2, Firebird) makes a clear distinct between procedural code and SQL. Procedural code can only be run in the context of a

Ident Authentication failed for user Centos 8 Postgresql12

梦想的初衷 提交于 2021-02-11 14:02:23
问题 So I have problem with ident Authentication on Centos 8 and postgresql-12. Errors below during server addition:::: pgadmin4 error creation server connection on localhost: postgres connect localhost I really tried many answers but no one worked for me. pg_nba.conf file now has following strings: local all all trust local all all md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5 host all all 10.1.1.0 File pg_ident.conf is empty so I don't have any mapping, Help me ples but after

Is there a way to find the sum of each row? postgresql

删除回忆录丶 提交于 2021-02-11 13:51:15
问题 Let's say you have a table of n columns like create table x (id integer x0 integer, x1 integer, x2 integer, x3 integer, ..... xn integer primary key(id) ) n can be a big number, also you don't know the names of the columns. Let's say you have 50 rows like insert into x (74934,1, 9, 21, 5....16) insert into x (58496,4, 2, 3, 19....52) ..... insert into x (10475,48, 245, 8, 71....111) Is there a way to find the sum of each row? Like 1 + 9 + 21 + 5 +...+ 16 = sum of first row 回答1: Using JSON(B)

Getting PSQLException while calling a Stored Procedure (which inserts record into lsa_user_info table) from Java method ( which is in DAO Layer)

回眸只為那壹抹淺笑 提交于 2021-02-11 13:46:57
问题 I am new to stored procedures. I want to insert a record with 20 column values into lsa_user_info table. I am invoking a stored procedure to do this task. Also, I'm expecting the resultset will return the primary key value of the record that was inserted ( user_id ). But, I'm getting this error instead: org.postgresql.util.PSQLException: **The column index is out of range: 20, number of columns: 19. lsa_user_info table definition : CREATE TABLE public.lsa_user_info ( user_id integer NOT NULL

golang append issue inside a for loop [duplicate]

泄露秘密 提交于 2021-02-11 13:46:35
问题 This question already has answers here : Range references instead values (3 answers) Using Pointers in a for loop (2 answers) Closed 9 months ago . Problem: append inside Users() for loop below adds the last item in users 3x into userRxs []*UserResolver Expectation: append should add each item inside users into userRxs []*UserResolver // Users return all users from Db func (r *RootResolver) Users() ([]*UserResolver, error) { var userRxs []*UserResolver users := r.Db.Users() for _, u := range

Power BI Service - Unable to refresh a postgresql source which doesn't support encrypted connections

久未见 提交于 2021-02-11 13:35:49
问题 I'm trying to refresh the data on a PostgreSQL server running on AWS with no SSL certificate on it. I'm able to refresh the datasets in the Power BI Desktop. However, I'm neither able to refresh nor able to perform a scheduled refresh in the Power BI service. How do we connect to a Postgres server which has no SSL certificate on it and perform a refresh on power BI service? I'm getting the following error: 回答1: Figured it out. The option was actually under the advanced settings of the dataset

自由软件基金会庆祝成立35周年

心已入冬 提交于 2021-02-11 13:28:50
美国东部时间 10 月 4 日,自由软件基金会(Free Software Foundation,FSF)在官网 发文庆祝 ”其为争取软件自由而奋斗的第 35 年“。 1985 年 10 月,自由软件运动的主要发起人 RMS(Richard Matthew Stallman)创办了这一非营利性组织,旨在推广自由软件及其理念。35 年后的今天,FSF 现任主席 Greg Farough 称他们的使命仍在继续,”直到每位计算机用户都能完全自由地践行所有数字任务后,我们的工作才算完成……自由软件的斗争仍在继续,没有你们,我们就不会在这里。“ FSF 计划用整整一周时间来做庆祝。其中,美国东部时间 10 月 9 日 12:00 至 17:00 将举行在线周年纪念活动,包括现场直播和预先录制的视频。因此,他们号召用户上传两分钟以内的简短视频,分享对自由软件或 FSF 的记忆片段,以及对软件自由的未来期盼。 除此之外,该基金会还提供了一些可行的庆祝方式,提议大家参与其中,包括但不限于: 为 FSF 捐款 35 美元; 尝试完全自由的 GNU/Linux 发行版; 下载并尝试使用 GNU 操作系统最古老的部分之一,即 GNU Emacs 文本编辑器; 用自由的程序替换一个非自由程序,例如使用 LibreOffice 而不是 Microsoft Office;

Postgresql : Append element in json array objects

隐身守侯 提交于 2021-02-11 13:25:21
问题 I have below jsonb data stored in table column as below: '{"info":[ { "database": "Oracle", "company" : "Oracle" }, { "database":"Sql Server", "company" :"Microsoft" }, { "database":"DB2", "company" :"IBM" } ]}' i need to append a element "License" : "Proprietary" to all objects present in json array like below: '{"info":[ { "database": "Oracle", "company" : "Oracle", "License" : "Proprietary" }, { "database":"Sql Server", "company" :"Microsoft", "License" : "Proprietary" }, { "database":"DB2