postgresql-9.5 Questions
0
I have a project build using Rails 4.2.5
When I have my code like
@job = Job.find(1)
update_job(attrs)
If any method is before_* returns false after_rollback is called but when I change my cod...
Voiceless asked 29/8, 2018 at 10:5
1
Solved
Assume some_table has two rows, with primary key 1 and 2. The following sequence of statements can cause a deadlock:
session 1: begin;
session 2: begin;
session 1: DELETE FROM my_table WHERE my_ke...
Mcclean asked 22/8, 2018 at 15:3
1
Solved
This question can be considered as a follow-up on my comment on Can two concurrent but identical DELETE statements cause a deadlock?.
I am wondering if the rows are locked in ascending my_status o...
Agogue asked 22/8, 2018 at 17:27
2
Solved
I am with PostgreSQL 9.5 X64 integrated with the open-source Parse Server. My table has the following structure.
objectId (text with fixed 10 characters),
item_id (integer),
item_name (text with v...
Siphonostele asked 24/7, 2018 at 5:54
1
I want to restore my database postgres using pg_restore in command line and i want to put the password of user directly in the command, I tried this command but doesn't work
pg_restore -h l...
Sine asked 21/6, 2018 at 15:6
1
Solved
There is one table in my schema that does not get autovacuumed. If I run VACUUM posts; on the table the vacuum process finishes nicely, but the autovacuum daemon never vacuums the table for some re...
Aura asked 15/6, 2018 at 8:50
3
Solved
I have a custom type defined in my database as
CREATE TYPE address AS (ip inet, port int);
And a table that uses this type in an array:
CREATE TABLE my_table (
addresses address[] NULL
)
I h...
Bunkhouse asked 30/5, 2018 at 20:1
4
Solved
I have had a look at other questions that match my subject but in my case the ambiguity, I believe, comes from variable having the same name as a column.
Here is a simplified version of the functi...
Upgrowth asked 30/5, 2018 at 21:3
2
When installing postgres9.5 on ubuntu 14.04, the following command stops at an error:
$sudo apt-get install postgresql-9.5 pgadmin3
Here is the error message:
Preparing to unpack .../postgresql...
Sarraute asked 11/10, 2016 at 18:3
1
Solved
While doing UPSERT in Postgres 9.5, is it possible to return null on INSERT success and return something ON CONFLICT?
I would like to something like this:
insert into "user" (timestamp, user_id, ...
Handyman asked 1/4, 2018 at 11:44
1
Solved
What is the meaning and purpose of the following statement in Postgres:
xmax::text::int > 0
This looks like casting to text and then casting again to integer ???
Mcgowen asked 1/4, 2018 at 11:58
2
Solved
Suppose I have the following table:
CREATE TABLE tags (
id int PK,
name varchar(255),
CONSTRAINT name_unique UNIQUE(name)
)
I need a query that will insert tags that do not exists and return...
Preemption asked 8/2, 2016 at 8:47
1
I have some questions about how postgres functions and transactions work.
Currently my function looks like this:
CREATE OR REPLACE FUNCTION test_function(some_id character varying)
RETURNS chara...
Petuntse asked 28/2, 2018 at 19:31
1
I want to create a postgres-xl cluster. The cluster includes 5 nodes, 1 GTM, 2 Coordinator and 2 Datanodes. The following are the details of nodes
GTM:
hostname=localhost
nodename=gtm
IP=127.0....
Vase asked 13/2, 2018 at 10:12
3
Solved
I want to create a trigger function. But I want to check if a specified column exists.
CREATE FUNCTION MyFunction()
RETURNS trigger AS '
BEGIN
IF NEW.A >= 5 AND NEW.B <= 5 THEN
// Do somet...
Urceolate asked 16/1, 2018 at 14:6
2
Solved
I have a user group named editor_users in my PostgreSQL 9.5 database. And my product table is granted select, insert, update and delete to editor_user members.
But I want to prevent my id column. ...
Lardon asked 5/1, 2018 at 7:13
2
Trying to do an upsert to maintain user first last login timestamp and platform. But the newly introduced upsert (insert on conflict) does not allow for inserting the output of a select query. Trie...
Vanish asked 8/12, 2015 at 18:51
2
Solved
how to get the table row count of all the tables present in particular schema in postgresql 9.5? I would like to have the result as table_name | row_count. How this can be done using query?
Demagogy asked 2/6, 2017 at 13:27
1
Solved
On SQlite I could do a query for PRAGMA user_version; and I could set the version if need be too. Is there anything in postgres that could do the same thing?
I tried select version() but that get...
Bid asked 16/5, 2017 at 15:38
0
I have installed [email protected] to my OSX El Capitan Machine using Homebrew 1.2. Unfortunately, upon installing Postgis, and performing CREATE EXTENSION postgis;
It returns,
ERROR: could...
Paisano asked 8/5, 2017 at 10:21
1
Solved
Say I have two host servers s1 and s2. In both the servers i have a schema named n1, now i have made some changes to some of the tables present in schema n1 of s1. I want the same change to be done...
Colloquium asked 25/4, 2017 at 6:28
2
Solved
Suppose I
have a table with columns a, b, c, and d
want SELECT queries with combinations of these columns to be blazing fast
expect a to be in every query
don't care about slow UPDATEs and INSERT...
Cirilla asked 12/4, 2017 at 20:49
3
Solved
In postgreSQL on a JSONB column I can run two queries with the same (?) result.
Query 1:
SELECT * FROM a WHERE b->>'c' = 'lorem';
Query 2:
SELECT * FROM a WHERE b @> '{"c": "lorem"}'...
Stefanistefania asked 16/3, 2017 at 11:12
2
Solved
For a list of ~700 ids the query performance is over 20x slower than passing a subquery that returns those 700 ids. It should be the opposite.
e.g. (first query takes under 400ms, the later 9600 m...
Himeji asked 5/11, 2016 at 21:29
1
Solved
Running Postgres-9.5. I have a large table that I'm doing ALTER TABLE table SET UNLOGGED on. I already dropped all foreign key constraints targeting the table since FK-referred tables can't be unlo...
Ockham asked 2/2, 2017 at 19:4
© 2022 - 2024 — McMap. All rights reserved.