Questions tagged as 'postgresql'

1
answer

How do I correctly pass the data type by PDO

In the php snippet below, what kind of PDO :: PARAM should I use? $cnx = new PostgreSQL(); //Classe de conexão do banco $data = '2015-02-13'; $select = 'SELECT * FROM eventos WHERE "data" = :data'; $query -> prepare($select); $query -> b...
asked by 13.02.2015 / 18:33
1
answer

Error Connection Database; "Relation does not exist"

I'm having trouble saving data from a screen to my database I'm getting the following error:    "org.postgresql.util.PSQL.Exception: ERROR: column" name "of relation" product_name "does not exist position: 29" heading 29 and the following...
asked by 21.12.2016 / 19:50
4
answers

Limit the number of SQL query rows

I have the following Query SELECT estado, num_ocorrencia FROM bra_ocorrencias WHERE nome like 'João' ORDER BY num_ocorrencia DESC It returns me all states with the most relevant occurrence numbers I have in the table, I would like to narrow...
asked by 05.07.2018 / 17:55
1
answer

SQL string combination

I need to generate all word combinations of a varchar of a record from a database. I need to develop in MySQL in PostgreSQL To get simpler: BASE DATA TABLE Howtomakeaprocedure/functionthatselecttherecordsanddot...
asked by 11.08.2016 / 19:25
3
answers

Help with select

I'm using the command select below: select f.no_equipe, h.no_pessoa_fisica, a.no_cidadao, d.dt_ficha from tb_cds_cad_individual a, tb_cds_atend_individual b, rl_cds_atend_individual_ciap c, tb_cds_ficha_atend_individual d, tb_equipe f,...
asked by 06.09.2017 / 19:41
1
answer

How to change null field to return nothing?

In a query has many fields unfilled, I would like to change the null being printed so that nothing appears in the print.     
asked by 18.05.2016 / 21:41
3
answers

How to group by weeks using sql?

I have the following problem. I have several requests, and I want to group them for weeks. I have already seen several examples, but almost none helped me, I would like to know if there is a function that when placed in Group by the result of th...
asked by 07.03.2016 / 13:04
3
answers

PostgreSQL database query

I'm trying to query Postgre with the following query: SELECT t3.desc_serv, t3.nm_serv, t1.nm_usu, count(t2.id_atend) TOTAL_ATENDIMENTO FROM usuarios t1 INNER JOIN historico_atendimentos t2 ON t1.id_usu = t2.id_usu INNER JO...
asked by 05.05.2014 / 17:11
1
answer

What is the Multi-Version Concurrency Control technique in PostgreSQL?

What is Multi-Version Concurrency Control (MVCC) in PostgreSQL and how is it working?     
asked by 27.03.2017 / 15:42
1
answer

What are INDEX, B-tree, hash, GiST, and GIN?

In the PostgreSQL manual has the following excerpt:    PostgreSQL provides the index methods B-tree, hash, GiST, and GIN.   PostgreSQL provides the B-tree, hash, GiST, and GIN index methods. But what are these methods? and what are thei...
asked by 30.11.2015 / 14:41