Recently the intern used the. Netcore to write the background app before using Java rewrite.
Specifies that the PostgreSQL database be used with the Spring boot framework. has been accustomed to the XML-based spring app, also no use of PostgreSQL, plus database design is not good, there is no code document, a face of the ignorant force ...
Here is a record of some of the problems encountered during the rewriting process, which are convenient for later review:
1. PostgreSQL 9.6.6:
(1) using PGADMIN4, the first problem is to start too slow, the memory is large, after connecting to the local database to execute a simple select time is a lot. Individuals think that starting too slow, the amount of memory is pgAdmin4 problem, but the execution of SQL statements slow, estimated to be a configuration problem, not yet found in the postgresql.conf corresponding configuration items
(2) For table names, column names are not case-sensitive, but they are all converted to lowercase and then run SQL. This leads to the following SQL,
Select from Question
Become
Select from question
Run again, then PostgreSQL went to find the question table, found no (because the building is the Question Table ... ), Error:
ERROR: not1Select* from Question
Workaround: Table name, column name plus "", as
Select * from "Question"
(3) because there is no access to the directory on the server, resulting in no way to backup/restore through Pgadmin
Workaround:
1. Create individual tables
2. Export the table data to a local
3. Importing data into a database table
from ' C:\users\~\question.csv ' ' , ' CSV HEADER;
Note the foreign key and data import order.
2. Spring Data JPA:
Spring Boot + Spring Data JPA + PostgreSQL