Liunx环境下源码安装PostgreSQL+PostGIS,检查功能的函数,如Touches(), Contains(), Disjoint() 还有一些空间操作函数,如Inter
生产环境中安装postgreSQL + postGIS
生产环境如下:
操作系统:
CentOS release 5.5 (Final)
需要安装:
postgresql 地址:
postgis 地址:
proj 地址:
geos 地址:
安装步骤:
postgre的安装 版本为9.1.3
vim INSTALL 可以查看其官方安装步骤:
...
配置一下环境变量:
LD_LIBRARY_PATH=/usr/local/pgsql/lib 动态连接库的所在目录
PATH=/usr/local/pgsql/bin:$PATH 为了方便使用,添加命令的搜索路径
输入pg_config 查看
postgreSQL 安装完毕。
注意事项:安装postgres 时
readline库(默认),命令行编辑功能,这个库虽然不是必须的(可以在配置阶段通过 --without-readline选项来取消),但是强烈建议安装readline,
使用psql时,可以使用方向键来选择和编辑前面键入的命令
查看是否安装过 rpm -qa | grep readline
zlib库(默认),主要用于pg_dump和pg_restore两个操作的数据压缩功能,这个库也不是必须的(可以在配置阶段通过--without-zlib选项来取消),
查看是否安装过 rpm -qa | grep zlib
在编译程序前必须要安装这些包,否则无法通过编译,此外,还有在配置阶段还有很多可选包,可以通过./configure --help查看
选项 描述
– prefix = prefix安装到prefix指向的目录;默认为/usr/local/pgsql
– bindir = dir安装应用程序到dir;默认为prefix/bin
– with-d ocdir= dir安装文档到dir;默认为prefix/doc
– with-p gport= port设置默认的服务器端网络连接服务TCP端口号
– with-t cl为服务端提供Tcl存储过程支持
– with-p erl为服务端提供Perl存储过程支持
– with-p ython为服务端提供Python存储过程支持
PostGIS 的安装 版本为 PostGIS 1.5.4 Release
首先下载源码包 proj-4.8.0,geos-3.3.3,libxml2-2.6.26,虽然这三个库不是安装postgis强制的,但是,没有这三个包,
postgis一定程度上失去了空间数据库的意义。因为Proj4提供了投影的相关操作,如postgis中的transform()函数,,geos则为postgis提供了很多拓扑

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1
Easy-to-use and free code editor
