S skills, Postgres skills

Source: Internet
Author: User

S skills, Postgres skills



If you need to add indexes when the business volume is large, you need to use CONCURRENTLY. Otherwise, your database will easily break down.


For example


create index CONCURRENTLY idx_order_records_bank_statist_uid on order_records(statist_uid)



See

Http://www.postgresql.org/docs/9.1/static/sql-createindex.html



In a large business volume, if you want to execute some time-consuming database tasks, sometimes you will find that a task is still secretly executed and needs to be manually disabled.


If you use the pid corresponding to kill, you may encounter database problems.


The insurance method is to use PG_CANCEL_BACKEND.


Find the corresponding PID through the following:



select pid, trim(starttime) as start, 
duration, trim(user_name) as user,
substring (query,1,40) as querytxt
from stv_recents
where status = 'Running';



View


select pg_cancel_backend(802);


Kill the task as follows:



pg_cancel_backend( pid )



Http://docs.aws.amazon.com/redshift/latest/dg/PG_CANCEL_BACKEND.html



Postgres Problems

1 bossjzl17 answered the command line solution

2. You can use the pgadmin graphical client tool to solve the problem.
When installing PostgreSQL on windows, select pgadmin.
If PostgreSQL is installed on Linux, you must install the pgadmin client separately.
You can also install the pgadmin client on windows to connect to linux.

Pgadmin has a wizard for import and export,

If it is helpful to you, please remember to adopt a satisfactory answer. Thank you! Wish you a happy life!

Vaela

Postgres Installation Problems

An error occurred while completely deleting and re-installing the database. Most of the problems were caused by the system environment.

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.