Questions tagged as 'postgresql'

2
answers

Can you tell which tables have a Bytea type field on a PostgreSQL basis?

I have a base with 500MB I consider small, but this is slow to open some tables, checking are tables that have Bytea field, the other programmer saved images in the bank, but it is unworkable to work, left the application slow, because sometimes...
asked by 02.05.2018 / 17:29
1
answer

send login information to the bank for comparison

I'm developing a system with login and password, using laravel. The registration part was even easy: public function salvar(){ $usu_email = Request()->input('usu_email'); $usu_senha = Request()->input('usu_senha'); $usu_tipo...
asked by 12.04.2018 / 21:49
2
answers

How to get records for the last 15 days - PostgreSQL

I have a table called Entrega where all the deliveries made with their respective dates are stored, how can I only deliver deliveries from the last 15 days? Doing so I can deliver from 10 October, for example: SELECT * FROM public.entre...
asked by 13.10.2017 / 16:46
2
answers

Import JSON to Database

I have a json file, and would like to import it into a database. Is there any way to automate this process? There is no database preference, but if it had some function for PostgreSQL it would be better.     
asked by 28.09.2017 / 16:19
2
answers

How do Postgres create a file to populate a bank?

I have a database in POSTGRESQL populated, wanted to know if a command exists SQL that returns a string that has the following command for all existing tables: INSERT INTO aluno(id , nome, idade ) values(1,'Raul',23) I wanted to do this...
asked by 15.05.2017 / 14:46
3
answers

UPDATE SUM +1 in decimal value

I need to set a UPDATE in a table, however, in the value field: '1481126826.2363343', I need that number to become '1481126826.2363344' The% w_that I'm trying and the following: UPDATE callcenter.chamada_agente SET uniqueid = SU...
asked by 15.12.2016 / 19:39
1
answer

Problem inserting into table in Postgresql

When I'm going to make a INSERT : INSERT INTO categoria (cat_descricao,cat_status) VALUES ('não' ,'1' ) by passing some element with accentuation the following error occurs    ERROR: 22021: invalid byte sequence for encoding "UTF8"...
asked by 14.12.2016 / 14:09
2
answers

Syntax for using INTERVAL

I have the following excerpt from a CASE in my SQL SELECT CASE WHEN (tabela01.data_abertura - INTERVAL tabela02.garantia 'month') <= tabela01.data_nf THEN 'Dentro do Prazo' ELSE 'Fora do Prazo' END AS med...
asked by 02.08.2016 / 15:56
1
answer

Java - How to validate user group in SQL and Save result?

Good morning, I have the following code in Java Desktop. I wanted to know how I can capture that user's group and save it to a variable. Since when it returns the value and stores in the variable "rs" does not contain information understood f...
asked by 30.11.2015 / 16:22
1
answer

How do I add a new column between 2 columns in PostgreSQL?

How do I add a new column between two columns already in my database in PostgreSQL? In MySQL do I use the AFTER function to add one column after another, and in PostgreSQL? How do I do this? SQL ALTER TABLE nota ADD hota_utc VAR...
asked by 15.07.2015 / 21:08