Data dodania Pytanie
2016-12-07 16:12 Postgres failover Error »
We are testing Postgres failover. After the primary brought down, I 'touch' the trigger_file as instructed. The slave now becomes the primary. Test in...
(0) odpowiedzi
2016-12-07 11:12 Running different versions of postgresql side by side »
I have postgresql 9.3 installed. I would like to have also postgres 9.6.1 installed. Each application is using a different DB. Most of the times I do...
(1) odpowiedzi
2016-12-02 16:12 Updating a time-stamp field in a PostgreSQL function using LOCALTIMESTAMP fails »
When I call this line outside of a Postgresql function both the status and last_updated feilds are updated. UPDATE data.listings_applications SET sta...
(0) odpowiedzi
2016-12-02 09:12 Configure trigram and custom search with pg_search in rails »
I implemented a search using pg_search gem on rails 4. Casecommons When I, for example, searching word "programming" - it works fine, and when searc...
(0) odpowiedzi
2016-12-01 11:12 JPA - How to set the value in additional column of the join table »
I have two entities Groups , Users DB tables groups, users groups_users (join table having four columns namely gid, uid , createdate, isdel...
(0) odpowiedzi
2016-12-01 10:12 PostgreSQL Function Syntax Error in DECLARE clause »
I am unable to create this function as I get syntax error near INTEGER in line 6. Am I missing something here? CREATE OR REPLACE FUNCTION public.upda...
(2) odpowiedzi
2016-12-01 02:12 PostgreSQL Slow query, Order by LIMIT »
List item mydbab=# \d+ table1; Table "dbmydb.table1" Column | Type | Modifiers | Scol5rage | Stats target | Descri...
(1) odpowiedzi
2016-11-30 00:11 postgres jsonb with issues »
I am trying to build a query that will go into a table. Grab some data from within a jsonb column and then query against that data further. WITH id_l...
(1) odpowiedzi
2016-11-28 23:11 Return query result from postgresql conditionally »
I am trying to write function that should return records based on my input parameter. Structure will differ based on input. Here is something similar ...
(0) odpowiedzi
2016-11-25 16:11 Cast decimal real to double precision produces strange behavior »
I'm trying to cast a decimal real to double precision and it has the following behavior: select 2.2::real::double precision; Outputs: 2.2000000476...
(1) odpowiedzi
2016-11-25 11:11 Deleting rows which do not have entries in another table as foreign keys takes ages to run »
There are two tables - image and box Table image has a primary key - id - which has a reference in the box table as image_id I have archived some ro...
(0) odpowiedzi
2016-11-24 09:11 Does Postgres support virtual columns? »
ALTER TABLE formation ADD p varchar(20) GENERATED ALWAYS AS (DAT_FM -> '$.position') VIRTUAL; ALTER TABLE formation ADD c decimal(12,3) GENERATED A...
(0) odpowiedzi
2016-11-22 22:11 Postgres locks within a transaction »
I'm having trouble understanding how locks interact with transactions in Postgres. When I run this (long) query, I am surprised by the high degree of...
(1) odpowiedzi
2016-11-22 10:11 After compiling pgpool-II-3.5.2 can't find /usr/lib/postgresql/9.5/lib/pgpool_recovery »
There are no librays and no folders in /usr/lib/postgresql/9.5/lib/ from pgpool-II-3.5.2 after install/compile. I can't copy files from ~/pgpool-...
(0) odpowiedzi
2016-11-21 12:11 Which postgresql index types suitable for XML data type »
Postgresql has 4 types of index which are btree (default), hash, GIN and GIST. Which index type suit most for the following scenarios: search XML d...
(0) odpowiedzi
2016-11-18 13:11 How can I get a CIDR from two IPs in PostgreSQL? »
In PostgreSQL, I can get the upper and lower boundary of a CIDR-range, like below. But how can I get the CIDR from two IP addresses (by SQL) ? e.g. ...
(1) odpowiedzi
2016-11-16 16:11 How to get distinct array elements with postgres? »
I have an array with duplicate values in postgres. For example: SELECT cardinality(string_to_array('1,2,3,4,4', ',')::int[]) as foo => "foo"=>"...
(1) odpowiedzi
2016-11-16 12:11 Function call in postgresql returns no resultset »
I have a postgresql function like create or replace function getalltypes(name character varying(100)) returns setof docs as $BODY$ begin perform c...
(1) odpowiedzi
2016-11-16 08:11 Search for a json array in jsonb column having data as json array in posgresql »
I have a jsonb column(gppermission) in my table doc which contains data as [{"Deny": "true", "Allow": "false", "GroupName": "Group 1 "}, {"Deny": ...
(1) odpowiedzi
2016-11-15 18:11 How to install and run postgress using docker-compose.yml version "1" »
1: docker-compose.yml postgres96: image: postgres:9.6 ports: - "5432:5432" volumes: - ./Postgres/data:/var/lib/postgresql/data env: ...
(1) odpowiedzi
2016-11-15 06:11 PostgreSQL text array - query as integer, ignoring non-digits »
I have a table of people. Each person can have several regnums (mostly integers but some like M/2344 and W345). To make things a bit more complicated,...
(1) odpowiedzi
2016-11-14 22:11 Postgresql equivalent syntax for FORALL »
Please share the equivalent syntax for the below statement in postgresql FORALL i IN 1..20 INSERT INTO emp2 VALUES (enums(i)); ...
(1) odpowiedzi
2016-11-12 23:11 Changing text to character varying not executing as intended »
I'm learning PostgreSQL and I'm trying to create a function to ALTER the data types of a given table that has columns with character varying data type...
(1) odpowiedzi
2016-11-12 04:11 postgresql cannot insert from table Cannot insert »
I am working on a PostgreSQL table that takes data from one table and inserts it into another. i created a table: create table temp_appearance (firs...
(1) odpowiedzi
2016-11-11 17:11 postgres function flexible query return »
What is a flexible way to create a function returning multiple rows? Im in development of a pg9.4 database, and it is not uncommon to modify the numbe...
(0) odpowiedzi
2016-11-10 13:11 Running a Servlet class without implementing HTTPServlet interface »
I have tried and searched a lot over the internet but unable to get a correct solution for my problem. I will try to describe my problem as much as I ...
(0) odpowiedzi
2016-11-08 18:11 Converting date into integer (1 to 365) »
I have no idea if there is a function in postgres to do that, but how can I convert a date (yyyy-mm-dd) into the numeric correspondent in SQL? E.g. ...
(2) odpowiedzi
2016-11-08 17:11 List all foreign keys that need index PostgresSQL »
I'm stuck in this problem, i need to list all foreign keys that might need index, until now I only make a query that list: "table_name" : "caloumn_na...
(0) odpowiedzi
2016-11-08 12:11 PostgreSQL SHOW work_mem shows 16GB but configured to 1024MB »
I'm working on a PostgreSQL 9.4 and wondering about my work_mem. If I query show work_mem; I get: work_mem text 16GB However if I grep the confi...
(0) odpowiedzi
2016-11-07 12:11 How to query a complete line and correct a misspelled word in Full text search using postgres sqlalchemy »
I am using the a materialized view named FullText table in postgres and trying to execute the result in flask sqlalchemy. I am able to query the FullT...
(0) odpowiedzi
2016-11-02 10:11 Return a range of elements from an array in Postgres json »
As known, in Postgres json, we can get one element at a specified index from an array using this: ["a","b","c"]::json -> 2 The script above retu...
(3) odpowiedzi
2016-11-02 06:11 Postgresql forall in sample code »
what is the equivalent code for the below logic in postgres BEGIN IF aaa.count > 0 then FORALL rec IN aa.FIRST .. aa.LAST ...
(0) odpowiedzi
2016-10-28 18:10 PostgreSQL use Select return in function »
I am trying to run a query like select id from table where id = pseudo_encrypt(select last_value from id_seq) .. select last_value from id_seq r...
(1) odpowiedzi
2016-10-26 23:10 Why is this query taking so long? How can I fix it? Postgres 9.4 »
Recently we changed the format of one of our tables from using a single entry in a column to having a JSONB column in the format of ["key1","key2","ke...
(0) odpowiedzi
2016-10-26 11:10 psql: FATAL: role "test" does not exist »
I am new to postgres and facing difficulty in connecting to DB after server reboot. I have created a database pgdb under an OS user test. After Serve...
(0) odpowiedzi