PostgreSQL Interview Questions & Answers

  1. Question 1. What Is Postgresql?

    Answer :

    This is regarded as one of the most successful open source database in the world. This is also used to create advanced applications. This relies on Object relational database management system. Familiarity with UNIX and Linux can be an added advantage while using PostgreSQL.

  2. Question 2. State Some Of The Advanced Features Of Postgresql?

    Answer :

    These are the following features which are present in PostgreSQL they are

    1) Object relational database
    2) Extensibility and support for SQL
    3) Database validation and flexible API
    4) Procedural languages and MVCC
    5) Client server and WAL.

  3. Oracle Interview Questions

  4. Question 3. Explain About Write Ahead Logging?

    Answer :

    This feature increases the reliability of the database by logging changes before any changes or updations to the data base. This provides log of database incase of a database crash. This helps to start the work from the point it was discontinued.

  5. Question 4. Explain About Multi Version Concurrency Control?

    Answer :

    Multi version concurrency control or MVCC is used to avoid unnecessary locking of the database. This removes the time lag for the user to log into his database. This feature or time lag occurs when some one else is on the content. All the transactions are kept as a record.

  6. MySQL Tutorial

  7. Question 5. How To Start The Database Server?

    Answer :

    1. /usr/local/etc/rc.d/ start
    2. /usr/local/etc/rc.d/postgresql start
  8. MySQL Interview Questions

  9. Question 6. How To Stop The Database Server?

    Answer :

    1. /usr/local/etc/rc.d/ stop
    2. /usr/local/etc/rc.d/postgresql stop
  10. Question 7. How To Check Whether Postgresql Server Is Up And Running?

    Answer :

    1. /usr/local/etc/rc.d/ status
    2. /usr/local/etc/rc.d/postgresql status?
  11. Django Tutorial
    MYSQL DBA Interview Questions

  12. Question 8. What Are The Languages Which Postgresql Supports?

    Answer :

    Some of the languages which PostgreSQL supports are as follows:
    It supports a language of its own known as PL/pgSQL and it supports internal procedural languages. Pl/pgSQL can be compared to oracle, PL/SQL, etc. Languages such as Perl, Python, TCL can be used as embedded languages.

  13. Question 9. Explain About The Command Enable Debug?

    Answer :

    This command is used for enabling compilation of all libraries and applications. This process generally slows down the system and it also increases the binary file size. Debugging symbols are present which can assist developers in noticing bugs and problems associated with their script.

  14. Java Developer Interview Questions

  15. Question 10. Explain About Functions In Postgresql?

    Answer :

    Functions are important because they help the code to be executed on the server. Some of the languages which can program functions for efficient use are PL/pgSQL which is the native language of PostgreSQL. Scripting languages are supported by many languages such as PHP, Perl, Python, etc. PL/R a statistical language can also be used.

  16. Question 11. Explain About Indices Of Postgresql?

    Answer :

    There are built in functions such as B-tree, hash table, and GIST indices can be used or users can define their own indices. PostgreSQL can scan the index backwards. Expression index could be created with the result of an expression. Partial index created with addition of WHERE clause.

  17. Oracle MySQL 5.6 Database Administrator Interview Questions

  18. Question 12. Explain About Triggers?

    Answer :

    By SQL query you can trigger an event. Triggers can be activated with the help of INSERT and UPDATE queries. These can be attached to tables. Triggers more than one can be triggered alphabetically. These triggers have the capability to invoke functions from other languages.

  19. Oracle Interview Questions

  20. Question 13. What Are The Different Data Types Supported By Postgresql?

    Answer :

    There are different data types which are supported they are: 

    1) Arbitrary precision numeric’s
    2) Geometric primitives
    3) Arrays
    4) XML etc
    Users can create their own indexes and make them indexed.

  21. Question 14. Explain About Database Administration Tools?

    Answer :

    There are various data administration tools they are

    1) Psql
    2) Pgadmin
    3) Phppgadmin

    Most of these tools are front end administration tools and web based interfaces. Out of these phppgadmin is the most popular one.

  22. Question 15. Explain About Pgadmin?

    Answer :

    Pgadmin forms a graphical front end administration tool. This feature is available under free software released under Artistic License. Pgadmin iii is the new database administration tool released under artistic license.

  23. Django Interview Questions

  24. Question 16. How Do You Create A Data Base With Postgresql?

    Answer :

    Creating a database is the primary step in creating a database. A command $createdb newdatabasedb


    This creates a new database and a message displays CREATE DATABASE which indicates that the creation of the database was successful.

  25. Question 17. What Are The Various Enhancements To The Straight Relational Data Model By Postgresql?

    Answer :

    There are various enhancements provided to the straight relational data model by postgre SQl they are support for arrays which includes multiple values, inheritance, functions and extensibility. Jargon differs because of its object oriented nature where tables are called as classes.

  26. iReport Interview Questions

  27. Question 18. Explain About Tokens?

    Answer :

    Tokens are also known to contain several special character symbols. It can be considered as keyword, constant, identifier and quoted identifier. Keywords include pre defined SQL meanings and SQL commands. Variable names such as tables, columns, etc are represented by identifiers.

  28. MySQL Interview Questions

  29. Question 19. Explain About String Constants?

    Answer :

    String constant contains a sequence of characters bound by single quotes. This feature is used during insertion of a character or passing character to database objects. PostgreSQL allows the usage of single quotes but embedded by a C style backslash. This feature is important in parsing data.

  30. Question 20. What Is Write Ahead Log?

    Answer :

    write-ahead log (WAL),  means it always writes the transactions to the log following with writing the modified pages to the disk to maintain the transaction ACID properties.

  31. Question 21. How To Created A Database?

    Answer :

    /usr/local/bin/createdb mydatabase

  32. Question 22. How To List The Number Of Database?

    Answer :

    su -l pgsql
    psql -l

  33. Question 23. How To Take Backup Of Database?

    Answer :

    /usr/local/bin/pg_dump mydatabase > mydatabase.pgdump

  34. Question 24. How To Create A Postgresql User?

    Answer :

    CREATE USER user WITH password ‘password’;

  35. MYSQL DBA Interview Questions

  36. Question 25. What Is A Sequence?

    Answer :

    A sequence is a special kind of database object designed for generating unique numeric identifiers. It is typically used to generate artificial primary keys.
    Sequences are similar, but not identical, to the AUTO_INCREMENT concept in MySQL.

  37. Question 26. What Is A Ctid?

    Answer :

    CTIDs identify specific physical rows by their block and offset positions within a table. They are used by index entries to point to physical rows. A logical row’s CTID changes when it is updated, so the CTID cannot be used as a long-term row identifier. But it is sometimes useful to identify a row within a transaction when no competing update is expected.

  38. Question 27. Why Do I Get The Error “error: Memory Exhausted In Allocsetalloc()”?

    Answer :

    You probably have run out of virtual memory on your system, or your kernel has a low limit for certain resources. Try this before starting the server:

    ulimit -d 262144
    limit datasize 256m

  39. Java Developer Interview Questions

  40. Question 28. How Do I Tell What Postgresql Version I Am Running?

    Answer :

    Run this query: SELECT version();

  41. Question 29. How Do I Create A Column That Will Default To The Current Time?

    Answer :


  42. Question 30. How Do I Perform An Outer Join?

    Answer :

    PostgreSQL supports outer joins using the SQL standard syntax. Here are two examples:

    SELECT * FROM t1 LEFT OUTER JOIN t2 ON (t1.col = t2.col);

  43. Question 31. How Do I Perform Queries Using Multiple Databases?

    Answer :

    There is no way to query a database other than the current one. Because PostgreSQL loads database-specific system catalogs, it is uncertain how a cross-database query should even behave.
    contrib/dblink allows cross-database queries using function calls. Of course, a client can also make simultaneous connections to different databases and merge the results on the client side.

  44. Question 32. Is Possible To Create A Shared-storage Postgresql Server Cluster?

    Answer :

    PostgreSQL does not support clustering using shared storage on a SAN, SCSI backplane, iSCSI volume, or other shared media. Such “RAC-style” clustering isn’t supported. Only replication-based clustering is currently supported.

  45. Question 33. Does Postgresql Have Stored Procedures?

    Answer :

    PostgreSQL doesn’t.

  46. Oracle MySQL 5.6 Database Administrator Interview Questions

  47. Question 34. How To Pronounce Postgresql?

    Answer :

    post-GRES-que-ell, per this audio file. Many people, however, just say “post-GRES”.

  48. Question 35. What Are New Features Postgre 9.1?

    Answer :

    As always, we can’t be certain what will go in and what won’t; the project has strict quality standards that not all patches can make before deadline. All we can tell you is what’s being worked on, which includes: synchronous replication, JSON support, security labels, nearest-neighbor geographic searches, SQL/MED external data connections, column-level collations, and index-only access. By the time 9.1 is released, though, this feature list will have changed considerably.

  49. Question 36. Does Postgresql Run On The Cloud?

    Answer :

    Yes. Like other open source databases, PostgreSQL is easy to run in virtual containers and is highly portable. Several companies have support for PostgreSQL in cloud hosting environments, including Heroku, GoGrid and Joyent.

  50. Django Interview Questions

  51. Question 37. How Does Postgresql Compare To “nosql”?

    Answer :

    The term “NoSQL” covers such a diverse array of non-relational database implementations … from tiny embedded databases like TokyoCabinet to massive clustered data processing platforms like Hadoop … that it’s impossible to comment on them as a general class. Non-relational databases preceded relational databases and have existed alongside them for forty years, so choosing between relational and nonrelational databases is nothing new. Users should choose the database whose features, implementation, and community support their current application needs. Further, using multiple different databases for large projects is fast becoming the norm, and PostgreSQL users are no exception.

  52. Question 38. How Does Postgresql Compare To Oracle/db2/ms Sql Server/informix?

    Answer :

    Our feature set is generally considered to be very competitive with other leading SQL RDBMSes. Certainly there are features some of them have which we don’t, and the reverse is also true. To date, only a few benchmarks have been published showing PostgreSQL to be within 10-30% of proprietary competitors. However, we have had many users migrate from other database systems � primarily Oracle and Informix � and they are completely satisfied with the performance of their PostgreSQL systems.

  53. Question 39. How Does Postgresql Compare To Mysql?

    Answer :

    This is a topic that can start several hours of discussion. As a quick summary, MySQL is the “easy-to-use, web developer” database, and PostgreSQL is the “feature-rich, standards-compliant” database. PostgreSQL is liberally licensed and owned by its community; MySQL is GPL-licensed and owned by Oracle. Beyond that, each database user should make his own evaluation; open source software makes doing comparisons very easy.

  54. Question 40. Explain About Concurrency With The Help Of Mvcc?

    Answer :

    Multi version concurrency control is used to manage concurrency. This feature is very useful because changes made in the database will not be visible to other users until the transaction is completed. This removes the need for read locks. ACID principles are given a further boost by this feature and can be implemented in general.

  55. iReport Interview Questions