Questions tagged as 'postgresql'

1
answer

How to handle Null fields in PostgreSQL [duplicate]

Hello, I need to know how best to use COALESCE to handle the null fields in my table. My problem is the following, I'm simulating 6 Stores and their respective cards, let's suppose that one or more stores did not sell product in the Amex card,...
asked by 07.02.2018 / 21:42
2
answers

How do I track version number in budget?

I'm breaking my head here to get a common denominator, I have a system in Delphi with PostgreSQL, this system has a budget session I need to track the changes made in these budgets by putting version number, ie with each change requested by t...
asked by 20.02.2018 / 14:35
1
answer

Add fields to a select

How do you put the driver and the idle in my SELECT: CREATE TABLE Obra_Assunto ( idassunto INTEGER NOT NULL, idobra INTEGER NOT NULL, PRIMARY KEY (idassunto, idobra), FOREIGN KEY (idobra)REFERENC...
asked by 06.06.2018 / 14:42
1
answer

NullReferenceException when trying to write to the database

I'm having this error, when I'm going to write form data to the bank.    Error: System.NullReferenceException: System.NullReferenceExceptionocorridoHResult=0x80004003Message=Referênciadeobjetonãodefinidaparaumainstânciadeumobjeto.Source=...
asked by 13.10.2017 / 14:52
2
answers

Is there any security problem using public schema in PostgreSQL?

First time I'm working with postgreSQL and I'm having this doubt if it has any security issues using the public Schema that it creates? Or if it's just a matter of organization     
asked by 12.10.2017 / 20:38
1
answer

Working with the application.properties file

See my application..properties file: spring.jpa.database=POSTGRESQL spring.datasource.platform=postgres spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create-drop spring.database.driverClassName=org.postgresql.Driver spring....
asked by 14.11.2017 / 17:32
1
answer

Error executing query in PostgreSQL

After executing this query: SELECT p.name as nomerecebe, r.created_at as datarecebimento, r.original_amount as valorboleto, rs.name as statusr, SUM(r.original_amount) as total FROM people as p, receipts as r, receipt_statu...
asked by 27.10.2017 / 21:41
1
answer

How to Migrate PosgreSQL Script to Mysql Script?

I have this database in Postgresql Script, how to convert to Msyql in order to create this database in this database? -- -- PostgreSQL database dump -- -- Started on 2010-07-03 09:40:14 SET statement_timeout = 0; SET client_encoding = 'UTF8'...
asked by 06.10.2017 / 18:30
1
answer

Select with when and case

I have the following select query: select F.nu_ine INE, to_char(D.dt_ficha, 'YYYYMM') as CMP, I.co_cbo_2002 CBO, CASE WHEN (B.tp_atend = 1 or B.tp_atend = 2 or B.tp_atend = 5) and I.co_cbo_2002 != '225142' THEN '0301010030' WHEN (B.tp_atend =...
asked by 09.11.2017 / 19:04
1
answer

How to remove the first character of a string in a Query

In PostgreSQL 9.2 I have a column with the following information: A101 B12 C3 I need a command to select and another one to update that column by removing the first character by doing so: 101 12 3 I tried to solve with the substring...
asked by 01.09.2017 / 22:32