Questions tagged as 'postgresql'

1
answer

Postgres: What is the best use of views or setof or function that returns table?

Out of curiosity to see the performance of the query, since within the view that it is a virtual table it can be generated just like doing a function that returns a SETOF if it were a query of a table, if it were of several inner join then the f...
asked by 24.04.2016 / 07:40
1
answer

Inner Join of Queries

I comment, I have a query that has a query that brings me certain users under certain conditions, and I have another query with other idusuarios submitted to other conditions, so I would have CONSULTA 1: XXX idusuarios CONSULTA 2: XXX i...
asked by 03.09.2018 / 21:43
1
answer

no-referrer-when-downgrade Laravel 5.5

This time I come for your help on another topic. I'm doing a form in Laravel 5.5, to enter a list of servers in a table, This table has many foreign keys. This is the structure of the table: <?php $title = isset($item) ? $item->nam...
asked by 05.09.2018 / 22:02
1
answer

How can I concatenate two fields for a drop-down list in Laravel 5.5

I have a drop-down list, but it shows me only the value of a column, I have a table called services, the first field is called name and the second is called version, Example Nombre Pgsql Version 9.1 I show the drop-down list with t...
asked by 15.08.2018 / 16:31
1
answer

Postgres saves json data with characters \ "

When you save the json in a jsonb column in Postgres, save it in this format "{friend: [{\" name \ ": \" paolo \ ", \" value \ ": \" warrior \ "}, {\" name \ ": \" (label) \ ", \ "value \": \ "\"}]} " I am sending this to you from ruby on r...
asked by 17.05.2018 / 17:53
1
answer

Make a count of a SQL count

Hello, I have the following query Select count(device) FROM entrada where badge = badge group by badge order by count desc; and I get a list of the times each badge has a device, what I want now is to join for example if the badge one is 5...
asked by 28.05.2018 / 18:51
1
answer

How can I use Postgres INTERVAL with the value of a table column?

INTERVAL is usually used as follows: select now() + interval '1 month' -> intervalo de tiempo What I want is to send you in the time interval, the number of months to add but with the value of the column of a table, for example: tabla....
asked by 23.11.2017 / 17:55
1
answer

Convert query in stored procedure to JSON in POSTGRES

Hello, I am doing a procedure stored in POSTGRES of type GET. I want to consult the information from this one but it sends me the following error: CREATE OR REPLACE FUNCTION p.products(_p_id TEXT) RETURNS TABLE ( _name TEXT , _total MONEY , _p...
asked by 21.11.2017 / 22:57
1
answer

Add a column several times with different conditions

I am working on postgres and I would like you to help me add a column several times with different conditions for example I have my column days that are arrears of credits and the capital column that generates a credit, I need to group them as t...
asked by 21.12.2017 / 13:07
1
answer

Is the server running on host "localhost" (127.0.0.1) and accepting TCP / IP connections on port 5432?

I have a DJANGO application on a server (digitalocean). Following a tutorial I have put the application in production with gunicorn, nginx, supervisor and postgres. It worked correctly, but then I restarted the server (reboot) and it no longer c...
asked by 20.10.2017 / 00:25