Questions tagged as 'postgresql'

2
answers

Working with PostgreSQL array data types using Hibernate

How to perform object retrieval and saving using columns of type array using Hibernate ? In my case I want to save String . How do I set% object_to%? I found the net some examples but they did not work. My class model...
asked by 25.03.2014 / 21:49
1
answer

I can not connect Jpa with PostgreSql at all

I'm trying to connect to postgresql , however, without success. My application will be a jsf application and so I'm using persistence. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com...
asked by 15.04.2014 / 03:56
1
answer

How to see which tables are accessed in postgreSQL?

How to view the tables being accessed by the select command? EX: select *from pg_stats I would like to get the tables that are having the most access on a given day in the database.     
asked by 21.08.2018 / 16:45
2
answers

Insertion into the database through Webservice

Good evening, I know very little about Webservice . And, through tutorials, I was able to create one. Content has been taken from this site: Creating Web- Service The query is done successfully, but now I need the user to enter s...
asked by 11.03.2015 / 01:13
2
answers

Rails and postgres group_by by date considering time zone

How do I group records by date where the field is of type datetime? But that's considering timezone. For example: When the user enters 12/10/2014 23:30:00, it is recorded in the bank 10/13/2014 01:30:00, because our time zone is -2: 00 now...
asked by 08.11.2014 / 13:31
2
answers

Why is not a good OR in a LEFT JOIN?

I am creating a query and my pull request returned because the code tester considered that OR is not good for table relationships. Example: FROM LEFT JOIN administracao.cidade cid ON (cid.cid_cd_cidade = cec.cec_c...
asked by 25.04.2018 / 15:48
1
answer

PostgreSQL Percentage

I can not perform the percentage of this query. You should take the sum of the "value_convenio" of each municipality and divide by the sum total of the "value_convenio" : <h3>Entrada SQL SEM CALCULO DE PORCENTAGEM</h3> SELECT...
asked by 09.04.2018 / 20:48
1
answer

Sort by month without repeating the year

I would like to add up the total sales in the month, but not repeat the year. select EXTRACT(year FROM v.dataVenda), case when EXTRACT(MONTH FROM v.dataVenda) =1 then sum(v.valorvenda) else 0 end as Jan, case when EXTRACT(MONTH FROM v.dataVend...
asked by 22.08.2018 / 15:02
1
answer

Is there any protection for files generated with pg_dump?

Is there protection for files generated by pg_dump? Anyone who has access to this file can restore it to any other database with pg_restore? Is there any protection in this file, some kind of password or something?     
asked by 12.05.2014 / 19:43
1
answer

How to turn this query into a JPQL?

I have the following query in the postgres database: select * from trabalha_projeto tp inner join Empregado e on e.matricula = tp.empregado How does it transform it into a JPQL query? I'm having a hard time returning values: First: not...
asked by 05.04.2016 / 03:33