Data dodania Pytanie
2017-06-10 11:06 How can I combine two selects in PostgreSQL function? »
Union blows up because of the JSON column, and apparently, temp tables are almost useless inside PostgreSQL functions. I'm coming from the MS SQL Se...
(1) odpowiedzi
2017-06-10 03:06 Invalid input syntax for type date: "\N" in postgresql when fetching data »
I'm using postgresql and getting this sql error: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type date: "\N" Here is m...
(1) odpowiedzi
2017-06-09 16:06 Modifying the schema of a table to make it inherit from another one without recreating the table or reinserting the data »
I have several tables in my PostgreSQL database that have a couple of common columns. I thought it would be a good idea if I move those common columns...
(2) odpowiedzi
2017-06-09 09:06 Postgresql postgis ST_DWithin always return true »
I need to calculate if one point is not more distant than a given radius from another point. I used the function ST_DWithin, in google maps I get lanL...
(1) odpowiedzi
2017-06-09 00:06 postgres users can login with any or no password »
So I set up a user called 'paperwork' with a database of the same name postgres=# create role paperwork; postgres=# create database paperwork; postgr...
(1) odpowiedzi
2017-06-08 12:06 Conversion of oracle timestamp to postgres timestamp? »
oracle timestamp example: 26-APR-17 09.40.13.243356000 Hi i have a scenario I am converting oracle timestamp to postgres timestamp but the output is ...
(2) odpowiedzi
2017-06-08 12:06 Date and time in UTC - how to store them in postgres? »
I am getting my data: date and time in UTC, in a csv file format in separate columns. Since I will need to convert this zone to date and time of the p...
(1) odpowiedzi
2017-06-08 11:06 Algebraic Data Types in Postgres »
Is it possible to create an Algebraic Data Type in Postgres and then use it as a column type? For example: CREATE TYPE hoofed AS ENUM('horse', 'goat...
(3) odpowiedzi
2017-06-07 23:06 PostgreSQL trigger prevents another one to work »
Suppose we have: create table T ( id bigserial primary key , a int , b int , c int ); I want c to be always equals to a+b and I want t...
(1) odpowiedzi
2017-06-07 22:06 stringify/casting jsonb to string w/reliable whitespacing for hash in postgresql similar to JSON.stringify »
I'm looking to create a hashing function for jsonb fields, but need to control the casting to string to allow for client and server integrity. In othe...
(0) odpowiedzi
2017-06-07 19:06 Map column value to table name and join »
I have a composite type that looks like CREATE TYPE member AS ( id BIGINT, type CHAR(1) ); I have a table that relies on this member type w...
(1) odpowiedzi
2017-06-07 14:06 Postgresql round timestamp to nearest 30 seconds »
is possible in postgres to round timestamp to nearest 30 seconds? For example: source -> result 2017-06-07 14:11:20 -> 2017-06-07 14:11:00 201...
(3) odpowiedzi
2017-06-07 14:06 How to get a preview for an image using postgresql? »
I'm using image tables in my database. I want to create a preview for the fetched image using PostgreSQL query. What is the syntax for creating a pre...
(0) odpowiedzi
2017-06-07 11:06 Simple word replacement in output from SQL »
I'm running PostgreSQL 9.4. Is there a replace string function which can take an array of words, or other similar function? Ex. SELECT REPLACE(my_c...
(2) odpowiedzi
2017-06-07 10:06 Remove model inheritance and keep id in newly created autofield »
I have a model which inherit from a non-abstract super model: class Person(models.Model): pass class User(Person): pass Because of a conce...
(1) odpowiedzi
2017-06-06 20:06 EFM - There is already a master node in this cluster »
I am unable to bring up the EFM cluster that I have (managing my postgres DB). 172.29.225.67 Witness 172.29.225.81 Master 172.29.225.82 StandBy I a...
(0) odpowiedzi
2017-06-06 18:06 How can I merge an existing jsonb field when upserting a record in Postgres? »
Say I have a table on Postgres with a jsonb column containing {"a": 1, "b": 2}. Now I'd like to upsert a record with the same id and {"b": 10, "c": 20...
(2) odpowiedzi
2017-06-06 17:06 EFM - FATAL: password authentication failed for user "efm" »
I am currently using EFM to monitor my Postgres cluster. My EFM (Master/StandBy/Wintess) nodes were working perfectly fine until we did a VM migratio...
(0) odpowiedzi
2017-06-06 13:06 PostgreSQL RETURNING fails with REGEXP_REPLACE »
I'm running PostgreSQL 9.4 and are inserting a lot of records into my database. I use the RETURNING clause for further use after an insert. When I si...
(2) odpowiedzi
2017-06-06 13:06 Django - How to filter a ManyToMany model object? »
I have the following models which are linked via a foreign key and ManyToMany relationship. from django.db import models from django.contrib.auth.mod...
(1) odpowiedzi
2017-06-06 08:06 how to restrict the table rights of certain tables for a certain user eventhough that user inherits from admin »
I have a user called 'user1' inherited from admin(who have all access to all tables).Is there any way in postgres such that if logged in as admin - al...
(0) odpowiedzi
2017-06-05 23:06 AR Query for jsonb attribute column »
I'm using Postgres for my db, and I have a column in my Auction model as a jsonb column. I want to create a query that searches the Auction's json col...
(2) odpowiedzi
2017-06-05 13:06 Heroku Rails - Turn off Active Record Postgres connection »
I have a rails 4 app I am hosting on heroku. They give some specific advice about how to manage your DB connection pool when using a multi-threaded se...
(1) odpowiedzi
2017-06-05 08:06 Optimizing postgres contains (LIKE) query in django for CHAR field »
So I've got a query for a search endpoint in my Django (postgres) backend like so: widgets = Widgets.objects.\ filter(user=request.user).\ fi...
(1) odpowiedzi
2017-06-05 00:06 Does Postgres guarantee to lock rows in the order of supplied update-statements? »
I like to do batch updates to Postgres. Sometimes, the batch may contain update-statements to the same record. (*) To this end I need to be sure tha...
(1) odpowiedzi
2017-06-04 23:06 Copy a row column from one table to another in ON CONFLICT »
Using Postgres 9.6, I am copying a row(selected columns) from one table to another. I am running: INSERT INTO copy_on_write(id, images) SELECT id...
(1) odpowiedzi
2017-06-04 20:06 How to return starting and end point of a path in a hierarchical structure »
I have a table that looks like that --------------------------- | id1 | id2 | col1 | col2 | +-----+-----+------+------+ | 1 | 1 | a | b | |...
(2) odpowiedzi
2017-06-04 19:06 efficient breadth first search using sql joins »
I'm dealing with a binary tree. So I have a database table in my database where each node is a parent to up to 2 other nodes. I have a plan to effici...
(1) odpowiedzi
2017-06-03 18:06 postgresql update column from select »
I am attempting to update a column from one table with a select query. It runs and updates the entire type_ column as religious (text field). I am...
(1) odpowiedzi
2017-06-03 13:06 Superuser expired and is the only user »
I'm using Postgres 9.5 on Windows 7. I have only one user postgres and I defined an expiry date for that user. Now I'm trying to connect after is ex...
(1) odpowiedzi
2017-06-03 07:06 How do I add reference to PostgreSQLCopyHelper to a .Net Core Web project? »
I'm a total newbie to the world of .Net Core and am coming up to speed on it. I have a .Net Core web service project which talks to a PostgreSql DB (...
(2) odpowiedzi
2017-06-02 20:06 Update a value for each jsonb object in array of objects PostgreSQL »
I apologize if this is a duplicate question. I've looked at the answers here: How do I modify fields inside the new PostgreSQL JSON datatype? and here...
(0) odpowiedzi
2017-06-02 18:06 Rails active record's 'where' method anomaly »
I tried the following statement in the rails console: SomeModel.where(["active = ? and price = ? and status_date <= ?", true , nil , Date.parse('2...
(1) odpowiedzi
2017-06-02 15:06 how to get the table row count of all the tables present in particular schema in postgresql 9.5? »
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_...
(2) odpowiedzi
2017-06-02 14:06 How to do same thing on multiple conflicts in PostgreSQL? »
For example if I have a table: create table test( username varchar(50) PRIMARY KEY, customer varchar(1...
(0) odpowiedzi