Encore's Blog

Web 开发者 | 专注于WEB应用程序的软件开发人员
如何从一张大表中导出部分数据
数据库 2017-12-03 邵壮

Our case is that we need to export part of the data on a large table on the server. Export data from table with condition to CSV file  psql -U username -d database -c "COPY (SELECT companies.* FROM companies WHERE companies.country_id = 10) TO stdout WITH DELIMITER ';' CSV" > country_10_companies.csv Download CSV data from server local scp serverip.com:/ho...

标签: PostgreSQL
如何设置PostgreSQL允许被远程访问
数据库 2017-07-28 邵壮

在同一局域网中与许其他用户的电脑访问自己电脑的PostgreSQL或者允许远端外网访问. 在此分享一下配置方法! 假如你使用的是Mac OS 有可能不太清楚你PostgreSQL的安装目录, 快速查看PostgreSQL目录 > brew info postgresql 最后一行你可以看到像这样的输出 `pg_ctl -D /usr/local/var/postgres start` 此时,也就是说对应的目录是/usr/local/var/postgres 然后我们进入postgresql目录  cd /usr/local/var/postgres 开始修改对应PostgreSQL的配置参数   1. 修改 postgresql.conf  添加下面一行,使PostgreSQL可以接受来自任意IP的连接请求。 ...

标签: PostgreSQL
Upgrade PostgreSQL from 9.5 to 9.6
数据库 2017-07-03 Encore Shao

Upgrade PostgreSQL from 9.5 to 9.6 # Stop current Postgres server: launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Initialize a new 9.6 database: initdb /usr/local/var/postgres9.6 -E utf8 # run pg_upgrade: pg_upgrade -v -d /usr/local/var/postgres -D /usr/local/var/postgres9.6 -b /usr/local/Cellar/postgresql/9.5.4_1/bin/ -B /usr/local/Cellar/postgresql/9.6.1/bin/...

标签: PostgreSQL
How to solve privileges issues when restore PostgreSQL Database
数据库 2017-07-01 邵壮

> sudo -u postgres psql psql (9.6.3) Type "help" for help. postgres=# \du List of roles Role name | Attributes | Member of -----------------+-------------+----------- <user-name> | Superuser | {} : Create DB postgres | Superuser | {} : Create role : Create DB postgres=# alter role <user-name> superuser; ALTER ROLE postgres=#

标签: PostgreSQL
如何创建PostgreSQL Docker Image on Mac
数据库 2017-05-29 邵壮

如何制作PostgreSQL Docker镜像 1. 编写 Dockerfile $ mkdir postgres9.6; cd postgres9.6 $ cat Dockerfile # vim:set ft=dockerfile: FROM ubuntu # MAINTAINER SvenDowideit@docker.com # Add the PostgreSQL PGP key to verify their Debian packages. # It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B...

标签: Docker PostgreSQL
This website uses cookies to ensure you get the best experience on our website.
Got it!