Development notes

Thoughts, notes and ideas about development

SQL Transactions and ACID

2016-11-27 6 min read Development Alexey Bogdanov
Transaction is a sequence of one or more SQL operations treated as a logical unit. Transaction could be completed either entirely successfully or not executed at all. Transactions and locking are important aspects of database for supporting multiple users. Into this tutorial we’ll take a look atTransaction, ACID, Isolation Levels. ACID Transaction must have the following properties called ACID, which means the following: Atomicity: means that transaction must happen as a single unit and exactly once. Continue reading

PostgreSQL functions

2016-11-23 4 min read Development Alexey Bogdanov
PostgreSQL has a lot of built-in functions, such as Trigonometric Functions, String Functions, IP address functions, etc. But we’re not limited by built-in functions. PostgreSQL (as well as other RDBMS) allows creating custom functions. In this tutorial we will take a look at user-defined functions. PostgreSQL supports the following programming languages for writing functions: SQL PL/pgSQL C PL/Python PL/Tcl some other languages Create functions with PL/pgSQL Functions written in PL/pgSQL can contain a variable declaration, conditional and looping constructions, exception handling and so on. Continue reading

How to install Maven on Windows 10

2016-11-23 2 min read Development Alexey Bogdanov
Maven is build tool primary for Java projects. In this tutorial I will describe how to install maven on Windows 10 operating system. Download and install Java To use maven we need to install Java first. If maven is used for Java projects java jdk should be installed, otherwise jre would be enough. Jdk or Jre could be found here. Download maven After Java (jre or jdk) is installed we need to download Apache Maven from official web site https://maven. Continue reading

Git cheat sheet

2016-11-22 2 min read Development Alexey Bogdanov
Git is distributed version control system It is very powerful tool and has a lot of features. Also there’re a lot GUI tools for working with git. But in this post I’ll show how to work with git from terminal (console) in Linux or using git-bash in Windows. The list of commands will be updated periodically. Identifying yourself To add user name and email globally: git config --global user.name "John Doe" git config --global user. Continue reading

PostgreSQL data types cheat sheet

2016-11-06 6 min read Development Alexey Bogdanov
In this tutorial I will show main PostgreSQL data types such as Boolean, Character, Number, Temporal. Also I will describe when and how we can use them. By the way, Postgres is not limited by the mentioned data types. It also supports such types like JSON, Monetary, Geometric , Network Addresses, etc. The full list of supported data types could be found here: Data Types Boolean Data Type The boolean type (could be shortened to bool) can store only 2 possible values true or false and NULLin case when value is unknown. Continue reading

Java: Ambitious method call

2016-10-30 1 min read Development Alexey Bogdanov
Ambicious method call error occurs when Java compiler doesn’t know which of the overloaded method to call. Let’s assume that we have the following overloaded methods: first method accepts the String parameter and prints it. The second method accepts Integer parameter and also prints it. public void print(String param) { System.out.println("Printing parameter + "param" + " as String"); } and public void print(Integer param) { System.out.println("Printing parameter + " + param + " as Integer"); } Calling one of the methods into the following way print(null) will attempt to the error like this: Continue reading

SQL Data Definition Language for Database in PostgreSQL

2016-10-14 2 min read Development Alexey Bogdanov
As was described into my previous post SQL Commands Types cheat sheet Data Definition Language, or just DDL, is a set of commands for creating, deleting, renaming databases and tables. In this tutorial I will describe how to use DDL with databases(schemes). PostgreSQL will be used for demonstration. How to setup PostgreSQL (and PgAdmin3) on Ubuntu please refer to this tutorial: How to install PostgreSQL on Ubuntu 16.04 CREATE database CREATE DATABASE blog; PostgreSQL will create a database named blog with default parameters. Continue reading
Older posts Newer posts