Data dodania Pytanie
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
2016-10-13 16:10 Distance between two 3D point in geodjango (postgis) »
my problem is the following: I created two points for the example: SRID=3857;POINT Z (62780.8532226825 5415035.177460473 100) SRID=3857;POINT Z (6278...
(0) odpowiedzi
2016-10-13 00:10 bdr_init_copy hangs indeffinately »
Fairly new to Postgresql, but have to get replication set up. I settled on BDR, and it works fine in the local demo, but on distributed machines it st...
(0) odpowiedzi
2016-10-10 18:10 Why the size of user tables is much less that the size of other objects in a PostgreSQL database »
I need help in understanding my database's size. I suppose the question is kind of simple for the database pros. I'm not a pro but I want to understan...
(1) odpowiedzi
2016-10-09 21:10 Procedure INSERT with CASE returning number of inserts »
I have 2 tables in my PostgreSQL database: 1) Plan ID (INT) m1 (NUMERIC) m2 (NUMERIC) m3 (NUMERIC) m4 (NUMERIC) m5 (NUMERIC) m6 (NUMERIC) m7 (NUME...
(0) odpowiedzi
2016-10-07 11:10 Geonetwork 3.0.3 initial map extent »
I installed Geonetwoek 3.0.3 from .war file in Tomcat 8.0 on windows server 2008 R2. The databse used is PostgreSQL 9.4. I want to show Slovenia after...
(0) odpowiedzi
2016-10-06 16:10 ERROR: syntax error at or near "CONTRAINT" »
I am trying to disable the fk temporary, for this I ran below command. ALTER TABLE ot_user DISABLE CONTRAINT fk_ot_user_pref_uid; After ran above q...
(1) odpowiedzi
2016-10-06 11:10 Create a DB in Postgres 9.4 with a PostGIS template without being a superuser »
I have created a PostGIS template: PSQL=/usr/pgsql-9.4/bin/psql -u postgres -d template_postgis $PSQL -d template_postgis -c "CREATE EXTENSION IF NOT...
(0) odpowiedzi
2016-10-06 10:10 REINDEX TABLE GIVES ERROR IN POSTGRES »
postgres=# REINDEX TABLE pg_catalog.pg_proc; ERROR: cross-database references are not implemented: "pg_catalog.pg_proc" ...
(0) odpowiedzi
2016-10-05 20:10 PostgreSQL DB after replication inaccessible - "role "postgres" does not exist" »
We have master-slave replication on PostgreSQL 9.4.9 CentOS 6.8 and till today we've had beautiful time with our replication between our two +- ide...
(0) odpowiedzi
2016-10-04 16:10 pg_dump does nothing in command prompt »
I opened an SQL Shell (psql) and entered my information: username, port, host, database and password. Then the name of the database popped up like so...
(0) odpowiedzi
2016-10-03 07:10 multiple column searching using postgris and django »
I am using Django 1.10 with postgres 9.5. I have created a custom 'User' model that has several columns such as gender, date_of_birth, height, weight,...
(0) odpowiedzi
2016-09-28 02:09 Postgres jsonb 'NOT contains' operator »
I'm experimenting with postgres jsonb column types, and so far so good. One common query I'm using is like this: select count(*) from jsonbtest WHE...
(0) odpowiedzi