Data dodania Pytanie
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
2016-10-25 12:10 SQL-Query with joining two tables »
I am breaking my brain on a SQL, maybe someone can give me a hint. Example setup: CREATE TABLE album ( name text NOT NULL, id serial NOT NULL, ...
(4) odpowiedzi
2016-10-24 07:10 Postgres pg_restore command to restore complete schema »
am using Postgres EnterpriseDB 9.5.0.5 I have taken a schema dump by using the below command pg_dump -n 'schema1' db1 > schema1.dump Now i wan...
(2) odpowiedzi
2016-10-23 08:10 SECURITY DEFINER - privileges of the function's creator, or owner? »
Postgres's official docs indicate that functions defined with SECURITY DEFINER run with privileges of the user who created it. However other sources,...
(1) odpowiedzi
2016-10-22 02:10 Can't persist array in a Postgres column using Active Record »
I know this question may sound duplicated, but none of the solutions I've found actually solved my problem. I have a model named pet with photos colu...
(0) odpowiedzi
2016-10-18 15:10 Postgres unique index for a date on a date time field »
I have a table event_logs with two columns of interest for which I would like to create an index. The problem is one of the columns is a datetime fie...
(1) odpowiedzi
2016-10-14 18:10 CamelContext: Failed create route contain quartz when database is unreachable »
My bundle installed into karaf container 4.0.7, that use camel-quartz22.17.3 In camelContext I have many routes such as "myRoute", it call a job quatr...
(0) odpowiedzi
2016-10-14 16:10 Save a Time object in JSONB »
I have a JSONB field in my database defined like this: t.jsonb :some_data, null: false, default: [] I've tried to save time objects to this field ...
(0) odpowiedzi
2016-10-14 13:10 PostgreSQL: row_to_json with selective columns »
Task concept and my question Using Postgres 9.4. How could I use row_to_json(row) with selective columns (not the entire row)? I need to discard one ...
(1) odpowiedzi