Posts

Showing posts from March, 2018

How to Install and Manage PostGIS with a Non-Superuser Role

Image
Prerequisite: PostgreSQL Version This guide assumes you are using PostgreSQL version 14 or later, which supports the necessary commands for PostGIS installation and management. Ensure your PostgreSQL server is up-to-date before proceeding. This guide ensures that PostGIS is installed and configured properly for a specific user, such as administrator , while avoiding common issues. 1. Ensure Superuser Access sudo -i -u postgres psql --dbname=financethat 2. Create a Role for PostGIS Management CREATE ROLE administrator WITH LOGIN PASSWORD 'your_secure_password'; GRANT ALL PRIVILEGES ON DATABASE financethat TO administrator; 3. Install PostGIS To install PostGIS on Ubuntu, first ensure you have the required PostgreSQL version installed. Then, use the following commands: sudo apt update sudo apt install postgis postgresql-14-postgis-3 Replace 14 with your PostgreSQL version if different. After installation, enable PostGIS in...

Regular Expression Fundamentals : Practical Examples

Image
Regular Expression Fundamentals : Practical Examples - LifeAdda Before getting into regular expressions, first needs to understand the data on we're planning to apply regular expressions. Below are few important data types : Characters a-z & A-Z Digits 0-9 Words letter, digit or underscore collection White-space white space is any character or series of characters that represent horizontal (Spacebar, Tab) or vertical space (Enter) in typography. Boundaries The word boundary is the position of word (letter, digit or underscore collection) Anchors ^ and $ called anchors Basic Meta-characters : * A line terminator is a one- or two-character sequence that marks the end of a line of the input character sequence. The following are recognized as line terminators: A newline (line feed) character ('\n') A carriage-return character followed immediately by a newline character ("\r\n") A standalone carriage-return character ('\r'...