Questions tagged as 'postgresql'

3
answers

How to select only the largest move in Sql?

I'm in need of some help finding the latest inventory of each product. It turns out that in the clause I made, it is returning all the sales related to that product, being that I only need the last one ... The sales are ordered by id. I've made...
asked by 23.03.2018 / 16:37
1
answer

Get table name with Trigger / Function in Postgres

I am implementing a simple replication form of two tables or more. I have the replication table that has the name of the table to be replicated and id. To feed the replication table I have a trigger on each table that will be replicated b...
asked by 11.01.2018 / 18:27
1
answer

phpPgAdmin: "Identification disabled for security reasons"

When installing phpPgAdmin on Linux, the following message appears: "Identification disabled for security reasons" . What can it be?     
asked by 12.01.2018 / 03:04
1
answer

Save text with line breaks in the DB

See below a java code to save a SQL command return in PostgreSQL. The command is EXPLAIN ANALYZE. The problem is that by saving this to the database, it loses the line breaks. Someone would know how to help me solve this, that is, so that when d...
asked by 16.01.2018 / 03:50
1
answer

How do I extract values from a json to insert into a table in PostgreSQL

I need to migrate from sql server 2017 to postgreSQL , but I have never used postgreSQL and am having difficulty. I need to convert an array json to values that are inserted into the table. In sql server I used a insert with...
asked by 23.01.2018 / 19:51
1
answer

How to know that the attribute is not null in the PostgreSQL database?

I'm developing a Java system with Spring Boot and created the table as not null as you can see: CREATE TABLE categoria ( codigo BIGSERIAL, nome VARCHAR(50) NOT NULL, PRIMARY KEY(codigo) ); The problem was that getting a...
asked by 15.11.2017 / 08:06
2
answers

Error importing xls into postgres

I'm trying to import an Xls file into the PostGresSql database, however when I run the submit on the page itself, the error below occurs: Undefined offset: 1 in C: \ wamp \ www \ projects ... line 59 Below is the code: <div clas...
asked by 13.12.2017 / 17:11
1
answer

Connect SpringBoot with PostgreSQL

I'm trying to connect the bank to SpringBoot and I'm finding that my problem is here: # =============================== # = DATA SOURCE # =============================== # Set here configurations for the database connection spring.datasource.u...
asked by 13.11.2017 / 19:46
1
answer

Does not return the number of records in the PostgreSQL database

I would like to know how many records in my database, but do not return the quantity. Look at the records in my database SQLcommandSelectcount(*)ascontaRegistrosfromtb_produtoswhereprod_nomelike'%"+ +"%'; Result     
asked by 30.10.2017 / 19:52
1
answer

SQL: Avoid repeating row and sum values

I have this select: select DISTINCT (clients.name) as nomeempresa, payments.amount_paid as pagamento, receipts.original_amount as recebimento FROM payments, receipts, receipt_status, payment_status, clients WHERE pay...
asked by 30.10.2017 / 17:48