Questions tagged as 'postgresql'

2
answers

Doubt in function in PostgreSQL

I'm doing a function in PostgreSQL and I want to use it to check whether a table already exists or not in a database, and if it does not exist, I want to create the table. The problem is in the function statement, which receives varchar...
asked by 19.09.2018 / 02:03
1
answer

treatment of multiple promisses in angular

I'm developing a code and at the same I build some areas of influence for given locations (with coordinates and radius of distance or walking time from the coordinate), so when I finish building it I have to query the database postgres to...
asked by 03.08.2017 / 21:38
2
answers

Left join with + equivalent in POSTGRES

oracle I can give a left join with using (+) ex: select from tabela1 A,tabela2 B where A.id = B.id(+); In the example above, a LEFT JOIN was made because I want to return all the data in table A that does not satisfy the JOIN co...
asked by 03.04.2018 / 16:34
1
answer

Is it possible to query the "INSERT INTO table SET field = 'value'" in PostgreSQL?

It is possible to execute the query INSERT INTO nome_tabela SET nome_campo = 'aaaa' in the PostgreSQL database. I needed to migrate a virtual store made in PHP with MySQL , to PostgreSQL . The part of the bank migration I got wi...
asked by 29.12.2017 / 04:52
2
answers

PostgreSQL query with no data return

See the following SQL code: SELECT * FROM venda ve WHERE ve.datavenda <= DATE '28/08/2016' The bank has the following data: The above SQL query is not returning any results, why? can you help me? Thank you in advance!     
asked by 07.09.2016 / 02:07
3
answers

psql command at the prompt. (Postgresql Bank)

Good morning, I'm trying to make a script with .bat extension to do automatic update in the bank, except that in order to do this I need to know how to enter the password of my bank through command. I'm doing the following to access my ban...
asked by 16.02.2017 / 17:13
1
answer

WHERE in bigint field []

I have to make a query to see if the code of a group is in the permissions to see the field. SELECT * FROM callcenter.pausa WHERE habilitado = 1 AND permissao_ver::varchar ilike '%1%' ORDER BY pausa ASC Result: {26,9,10,7...
asked by 25.01.2017 / 19:25
1
answer

Using oid column in PostgreSQL as primary key is correct?

PostgreSQL creates by default the OIDs (object identifiers) column, you can get it done. select oid, * from table I have a table that has no primary key, and I want to map it in Fluent nHibernate (C #). Is it better to use oid as...
asked by 18.11.2016 / 12:58
1
answer

PostgreSQL syntax error using keys

I'm having trouble understanding why pgadmin is pointing to a syntax error in my query . select first_name, coalesce(to_char(avg(p.amount),'99.99'), 'nnn') valor_medio from { select c.first_name as nome_cliente, c.last_name...
asked by 22.12.2015 / 14:35
2
answers

PostgreSQL COUNT function does not work

The problem is simple but I can not understand where I am wrong, I need to check the amount of results of the following sql: SELECT f.id,sum(p.valor) as valor_fatura, f.valor_desconto as desconto, (f.numero || '/' || f.ano_fatura ) as numer...
asked by 16.06.2017 / 21:36