PostgreSQL

PostgreSQL tutorial for Beginners – PostgreSQL – Functions

PostgreSQL – Functions   PostgreSQL functions, also known as Stored Procedures, allow you to carry out operations that would normally take several queries and round trips in a single function within the database. Functions allow database reuse as other applications can interact directly with your stored procedures instead of a middle-tier or duplicating code. Functions can …

PostgreSQL tutorial for Beginners – PostgreSQL – AUTO INCREMENT

PostgreSQL – AUTO INCREMENT   PostgreSQL has the data types smallserial, serial and bigserial; these are not true types, but merely a notational convenience for creating unique identifier columns. These are similar to AUTO_INCREMENT property supported by some other databases. If you wish a serial column to have a unique constraint or be a primary key, it must now …

PostgreSQL tutorial for Beginners – PostgreSQL – LOCKS

PostgreSQL – LOCKS   Locks or Exclusive Locks or Write Locks prevent users from modifying a row or an entire table. Rows modified by UPDATE and DELETE are then exclusively locked automatically for the duration of the transaction. This prevents other users from changing the row until the transaction is either committed or rolled back. The only time when users …

PostgreSQL tutorial for Beginners – PostgreSQL – TRUNCATE TABLE Command

PostgreSQL – TRUNCATE TABLE Command   The PostgreSQL TRUNCATE TABLE command is used to delete complete data from an existing table. You can also use DROP TABLE command to delete complete table but it would remove complete table structure from the database and you would need to re-create this table once again if you wish to store …

PostgreSQL tutorial for Beginners – PostgreSQL – ALTER TABLE Command

PostgreSQL – ALTER TABLE Command   The PostgreSQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You would also use ALTER TABLE command to add and drop various constraints on an existing table. Syntax The basic syntax of ALTER TABLE to add a new column in an existing table is as follows …