Spring Boot + Spring Data JPA + PostgreSQL

Source: Internet
Author: User
Tags postgresql

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.