Questions tagged as 'postgresql'

1
answer

Initial Value Sequences Postgresql - Laravel 5.1

Hello, I'm running some tests in my application, but I'm having the following problem: After migrate and db:seed , whenever I'm going to insert some registry by applying a duplicate primary key error. I have already seen that this e...
asked by 11.01.2016 / 13:43
1
answer

Ambiguous column - Laravel 5.1

Good morning! It's the following ... I have these 2 tables in my postgresql database: tipos_risco --id --nome agentes_risco --id --nome --id_tipo_risco (foreign key) The problem is that I am not able to extract the data from them together,...
asked by 06.01.2016 / 13:50
1
answer

ID (auto-increment) too high can be harmful?

I have a table that has a very high turnover of information, that is, many records come in and many come out as well. With this the ID (auto-increment) is much higher than the data value in the table. For example, the table has 530 records an...
asked by 19.01.2016 / 18:30
2
answers

PostgreSQL Trigger post update

Let's imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) I now need a trigger that every time I run a UPDATE or INSERT i...
asked by 08.11.2016 / 17:28
1
answer

How to add the numbers of a column in the bank that has the same id and that repeats itself?

I have a table named venda_itens which has venda_id , item_id and item_quantidade . I'd like to bring back the item name with the total number of items sold, and the quantity of total items inner join...
asked by 01.11.2017 / 00:00
1
answer

How to insert an encrypted field into a table in PostgreSQL?

I wanted to know how to insert an encrypted field into a table in the database. To illustrate my question let's suppose I have the following java class: package pessoa; public class Pessoa { private String email; private String senha...
asked by 25.09.2015 / 23:07
1
answer

How to change the default schema of postgresql in persistence.xml in a java application

I'm developing an application and I'm having a hard time changing the default application schema. I'm using PostgreSQL in a Java application with JPA and Hibernate as an implementation. persistence.xml <persistence-unit name="comu...
asked by 19.04.2014 / 23:38
2
answers

Add multi-line values under condition

Good afternoon gentlemen, I have a query that returns me some fields I need the sum of them, only that before a condition select adm.adm_ds_administradora as descricao, sum(car.car_vl_cartao) as valor, 'Cartão TEF' as c...
asked by 28.05.2018 / 20:05
1
answer

How to back up a PostgreSQL database using pgAdmin 4

I'm trying to generate a backup of my PostgreSQL database through pgAdmin 4, however whenever I try to backup an error occurs: I'msettingthePostgreSQLpreferencesasfollows: AndwhenIsetupthebackupI'mdoingitthisway: Ifyouhaveanysuggestionsastow...
asked by 30.11.2016 / 12:30
1
answer

Implement Triggers in Postgre

Can you implement a trigger to work in a column that is present in all database tables?     
asked by 28.10.2017 / 19:50