Home » Programming

How to Install PostgreSQL on Linux (Ubuntu/Debian/Arch/Red Hat/Fedora)

How to Install PostgreSQL

This article will instruct you how to install the PostgreSQL database server on Linux – Red Hat/Fedora, Ubuntu, Debian, and Arch Linux. Installing PostgreSQL on Debian Linux Here’s now to install PostgreSQL on the Debian Linux distribution (and distributions based on it): From the Default apt Repository You can install PostgreSQL server straight by the apt software repository on Debian Linux by running: Note the use of the sudo command to run the package installation as the root (administrative) user. Installing More Recent Versions From the PostgreSQL apt … Read more

Home » Programming

PostgreSQL vs Oracle – What’s the Difference? Which Should I Use?

PostgreSQL vs Oracle

This article will explain the differences between PostgreSQL and Oracle Database, and help you to decide which you should use in your project (The answer is PostgreSQL). Choosing the right database for your application, whether it’s a webapp, mobile app, or desktop application is vital. Changing database backend mid-development could be a costly (in both your time or money) and frustrating experience. Trying to decide between other databases like MySQL, MariaDB, MongoDB, SQLite and MSSQL? Check out our other guide here. Oracle Database Oracle Database, otherwise … Read more

Home » Programming

How to Declare Variables in PHP (Constants, Static, Global)

PHP Declare Variable

This article shows you how to declare variables in PHP, including constant, static, and global variables. Code examples are provided. What is a Variable? In computer programming, a variable stores a value, giving it a name that can be used to access it. Once a variable has been created and a value has been assigned to it, the value can be retrieved using the name given to the variable. The value of a variable can be updated (unless the variable has been declared as a constant), and the … Read more

Categories PHP

Home » Programming

How to Check What Version of PostgreSQL You are Running on Linux

PostgreSQL Check Installed Version

This article will show you how to check the version (or versions) of PostgreSQL running on your Linux system. As it is possible to install multiple versions of PostgreSQL on the same machine, there are a few ways to check the running version, which are detailed below. Checking PostgreSQL Server Version To check the running PostgreSQL server version, use the following pg_config command: Check PostgreSQL Client Version To check which version of the PostgreSQL client you are running, run the following psql command: Finding the PostgreSQL Executables If you … Read more

Home » Programming

Safely Using PHP Variable Variables with Arrays [Examples]

PHP Variable Variables and Arrays

PHP variable variables are a powerful way to add flexibility to your code. This article explains the pitfalls and solutions to using them with arrays. Variable variables are a great way to simplify your code and make it more readable. However, when using them with arrays, you need to be careful. PHP Arrays and Variable Variables To use variable variables with PHP arrays, extra considerations need to be taken to resolve potential ambiguities in your code. Consider the following PHP code: To what exactly is the array key … Read more

Categories PHP

Home » Programming

How to Test Connection to PostgreSQL Database on Linux (Ubuntu/Debian/Fedora)

Test Connection to PostgreSQL Server Database

This short tutorial will demonstrate how to test the connection to a PostgreSQL database locally and remotely from Linux. This article is part of our series on getting started with PostgreSQL, head back to our index that lists our full PostgreSQL guide. Testing PostgreSQL Database Connection on Ubuntu/Debian To test connectivity to a PostgreSQL server, you’ll need the PostgreSQL client installed if it is not already. Do this by running: Then, you can use the pg_isready command to test the connection to a database: One of the following … Read more

Home » Programming

Is PostgreSQL an SQL or NoSQL Database?

PostgreSQL is not NoSQL

A common question is whether PostgreSQL is an SQL or NoSQL database (it’s not) – this article explains why. What is SQL SQL (pronounced sequel or S-Q-L) is the Structured Query Language – a language used by many relational database systems for querying data. It is also increasingly being used for defining data schemas in data analytics applications where the data is not stored in a database but is arriving as a data stream. Data defined and queried by SQL is structured tables that can have relationships between records – for example … Read more

Home » Programming

How to Include a JavaScript File in Another JavaScript File [Examples]

How to Include a JavaScript File in Another

This article will detail the various methods for including a JavaScript file in another JavaScript file – providing several methods for use in the browser, and when working in Node.js. One of the cornerstones of programming is reusable code. This concept is encapsulated in the DRY (Don’t Repeat Yourself) principle – that if you need to do something multiple times, you write the code for it once, and re-use it where it is required, rather than having multiple copies of the same code in your code base. … Read more

Home » Programming

JavaScript Reference: Complete List of Operators + Examples

JavaScript Operators

This article will explain and list JavaScript operators and expressions. JavaScript operators perform a given operation on the provided expressions or values. Common operations include comparisons, arithmetic, and ternary operations. You will use JavaScript operators frequently (even the simplest JavaScript code will use multiple operators!), so it’s worth getting to know them, and their expected behaviour. What are Operators and Operands? Javascript operators perform a given operation, for example addition, subtraction, and other arithmetic, comparisons like greater than/less than, and more complicated operations like ternary/comparison … Read more

Home » Programming

PHP Scopes in Functions, Loops, Modules, With Examples

PHP Variable Scopes

This article explains what variable scopes are, and how they work in the PHP programming language, with code examples. When programming in any language, you must be aware of how variables are scoped – otherwise, you risk unexpected behaviour, including incorrect calculations, or loss of data – detrimental outcomes for any application (especially if you are working with business records or financial data) that will result in angry users. What is a Variable? In computer programming, a variable stores a value, giving it a name that can … Read more

Categories PHP