Questions tagged as 'postgresql'

1
answer

Error uploading rails server

I have Fedora installed on my machine with PostgreSQL 9.4 . However, whenever I try to upload the Rails server, this error appears:    FATAL: peer authentication failed for user "api" However, when running systemctl status postgresql-...
asked by 22.08.2015 / 02:54
0
answers

PHP Warning for no apparent reason!

I want to make a simple connection to the database but every time I test it, after a long loading of the page it generates a Warning. File bank.class.php: <?php abstract class banco { public $servidor = "localhost"; public $usuar...
asked by 15.09.2015 / 23:45
0
answers

Returning empty table

create function teste( teste varchar ) returns setof record AS $$ begin execute teste; return ; end; $$ language plpgsql; select teste ('select * from public.opcional '); Is this returning me a record with nothing like how do I disp...
asked by 07.05.2015 / 22:10
1
answer

Return last entry of each object in the database

I have two tables: monitor_carro id serial | setor_id | modelo | ano | placa monitor_evento id serial | lat | long | data | fkfuncionario_id | time | carro The monitor_evento table only has a foreign key th...
asked by 25.02.2015 / 19:24
1
answer

How do I create DESTROY link with Slim?

I'm starting with Rails, and I'm not able to create a link to delete a "post" from the site. Follow the links new and edit p.btn = link_to "Editar informações", edit_property_path(@property) if current_user == @property.user...
asked by 04.12.2014 / 21:00
1
answer

Restore a PostGis dump 2

I'm trying to restore a dump from a postgresql database with postgis template. When I try to restore the dump by terminal, I have a series of errors. Terminal used command:    psql archeology -U cc1295225 -h 127.0.0.1 -p 45432 < exits_o...
asked by 11.02.2014 / 21:14
2
answers

Postgres-case when

select x.codigo,x.nome,x.cpf,x.contato, x.limite_credito, x.pendencia as pendencia from ( select p.codigo,p.cpf,p.contato,p.limite_credito,p.grid,p.grupo,p.nome, p.flag,p.tipo,m.child,m.pessoa,coalesce(sum(valor),0) as pendencia from movto m...
asked by 07.05.2017 / 04:17
2
answers

Make a Postgresql bank count

Good morning. I wanted to make a select in my bank and return the number of registrations. Example: tb_client; column: dt_cadastro; In the dt_cadastro column I have this: 2000-01-20 2001-10-05 1990-11-09 1990-07-16 1990-08-10 I...
asked by 23.03.2017 / 14:03
1
answer

Test UPDATE in Postgres

The idea is to do a search with the result of BEFORE, execute UPDATE with the appropriate changes and perform a new search with the DEPOIS, then undo all changes, a test for UPDATE. SELECT id_evento, id_statusevento FROM syo_evento WHERE id_ev...
asked by 12.01.2018 / 12:17
1
answer

result of ajax in php session

I am filtering a cpf / cnpj through imput / datalist and checking the result with ajax. I want to bring the result in 2 php sessions but I can not. The page that contains the filter: <!doctype html> <html> <head> <meta...
asked by 03.05.2018 / 00:04