postgresql

odoo 12 error - You don't have the permission to access the requested resource. It is either read-protected or not readable by the server

北战南征 提交于 2021-01-29 07:53:07
问题 I'm getting following error while loading my odoo 12 server on windows 7 You don't have the permission to access the requested resource. It is either read-protected or not readable by the server. But while loading through private window, it is loading!. Even though not able to create a database there.I'm getting following error at that time. Database creation error: relation "ir_model" does not exist LINE 1: SELECT * FROM ir_model WHERE state='manual' ^ I have installed postgresql 9.2 which I

create database, simplest way possible using psql commands

一世执手 提交于 2021-01-29 07:21:49
问题 So I installed postgreSQL version 9.2.4 using the default installer settings on Windows 7 64 bit. Then I launched the SQL Shell(psql) command line tool and enter all the defaults plus the password I used during the install. It logs in. The problem is that a database cannot be created, or so it appears. I typed in creatdb mydb also tried CREATE DATABASE mydb I assume something happens, but when I type \list I just see the default installed databases. Am I missing something here? Coming from

Postgresql syntax in ms access

独自空忆成欢 提交于 2021-01-29 07:21:01
问题 I was reading this link: Does PostgreSQL support "accent insensitive" collations? about how to use accent insensitive queries. and this link PostgreSQL: How to make "case-insensitive" query about using case insensitive queries. Tested a query in pgAdmin: SELECT * FROM Customers WHERE unaccent(Customers.customername) ILIKE unaccent('abc%') and it works fine. It gives me the expected results. However, my front end is in MS Access 2016, is there a way to send this query to Postgres from within

How to create a User in PostgreSQL with SELECT, INSERT, UPDATE,… [DML] access

南笙酒味 提交于 2021-01-29 07:04:00
问题 I'm trying to create two users in PostgreSQL Who(user1) can access the tables in db1 and should be able to run (DML) SELECT, INSERT, UPDATE... Who(user2) can only create the tables in a particular database(EX: db1) Commands I tried are like below, but when I create a new table using user2, user1 not able to select/insert on tables. User1: grant CONNECT ON DATABASE db1 to user1; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO user1; ALTER DEFAULT PRIVILEGES IN SCHEMA

Sqlalchemy.exc.OperationalError: (psycopg2.OperationalError)

梦想的初衷 提交于 2021-01-29 07:00:50
问题 My Flask app(postgresql db) is working fine in local. I pushed my code to server and there I tried to run.py db migrate , it throws me these errors Traceback (most recent call last): File "run.py", line 11, in <module> create_app().run() File "/usr/local/lib/python2.7/dist-packages/flask_script/__init__.py", line 412, in run result = self.handle(sys.argv[0], sys.argv[1:]) File "/usr/local/lib/python2.7/dist-packages/flask_script/__init__.py", line 383, in handle res = handle(*args, **config)

Update multiple columns on conflict postgres

℡╲_俬逩灬. 提交于 2021-01-29 06:40:50
问题 I have to write a query to update a record if it exists else insert it. I am doing this update/insert into a postgres DB. I have looked into the upsert examples and most of them use maximum of two fields to update. However, I want to update multiple columns. Example: query="""INSERT INTO table (col1,col2,col3,col4,col5,col6,col7,col8,col9,..col20) VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s) ON CONFLICT(col2) DO UPDATE SET (col1,col2,col3,col4,col5,col6,col7,col8,col9,.

How can I configure JPA for a postgres database schema?

只愿长相守 提交于 2021-01-29 06:34:18
问题 I have an existing postgres database with the database "testdb" and the database schema testdbschema". If I use the default persistence.xml configuration of RESOURCE_LOCAL the following property is working: <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://server:port/testdb?currentSchema=testdbschema" /> I want to configure my database connection within my web.xml as a data-source. Everything is working well, except the configuration of the database schema. Here is my web

How to get Returned Query Object of PostgreSql Function in Python?

醉酒当歌 提交于 2021-01-29 06:25:43
问题 With pgsql function SelRec(integer) as defined below: -- select record CREATE OR REPLACE FUNCTION SelRec(_sno integer) RETURNS SETOF app_for_leave AS $BODY$ BEGIN RETURN QUERY SELECT * FROM "app_for_leave" WHERE "sno"=_sno; END $BODY$ LANGUAGE 'plpgsql' VOLATILE; I tried to call this function inside my python code, and expected the returned result as query object which furthermore I could get an individual value inside the query object. import psycopg2 connection_string = 'postgresql:/

Why does st_intersection return non-polygons?

南笙酒味 提交于 2021-01-29 06:08:52
问题 I have two polygon layers. I want to run st_intersection on them, to give the result of the areas where they overlap as a new layer. The new layer should contain the attributes from both input layers. I found this image which seems to illustrate my desired end results. My two input layers are both polygons: SELECT st_geometrytype(geom), COUNT(*) FROM a GROUP BY st_geometrytype(geom) -- Result is 1368 st_polygons SELECT st_geometrytype(geom), COUNT(*) FROM b GROUP BY st_geometrytype(geom) --

Cannot use save() to insert when previously importing data using data.sql

五迷三道 提交于 2021-01-29 06:08:08
问题 I'm terribly sorry if I can't start another post which is connected to my previous one but my question is somewhat different. I noticed that I really can save new data in my database as long as I never added data to the database by using the line spring.datasource.initialization-mode=always in my application.properties and made a data.sql file with a few insert statements. Once I insert the data using that file, I can access the data and show it to the user, but I can't create any new data