Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

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.

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.

2.

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.

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.

3.

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.

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.

4.

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.

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.

5.

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.

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.

6.

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.

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.

7.

How To Pronounce Postgresql?

Answer»

post-GRES-que-ell, per this audio file. Many PEOPLE, HOWEVER, just SAY “post-GRES”.

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

8.

Does Postgresql Have Stored Procedures?

Answer»

POSTGRESQL doesn't.

PostgreSQL doesn't.

9.

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.

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.

10.

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.

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.

11.

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);
or
SELECT * FROM t1 LEFT OUTER JOIN t2 USING (col);

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);
or
SELECT * FROM t1 LEFT OUTER JOIN t2 USING (col);

12.

How Do I Create A Column That Will Default To The Current Time?

Answer»

Use CURRENT_TIMESTAMP:
CREATE TABLE TEST (x INT, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );

Use CURRENT_TIMESTAMP:
CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP );

13.

How Do I Tell What Postgresql Version I Am Running?

Answer»

RUN this QUERY: SELECT VERSION();

Run this query: SELECT version();

14.

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

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

15.

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.

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.

16.

How To Create A Postgresql User?

Answer»

CREATE USER user WITH PASSWORD ‘password’;

CREATE USER user WITH password ‘password’;

17.

How To Take Backup Of Database?

Answer»

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

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

18.

How To List The Number Of Database?

Answer»

SU -L pgsql
psql -l

su -l pgsql
psql -l

19.

How To Created A Database?

Answer»

/usr/local/bin/createdb mydatabase

/usr/local/bin/createdb mydatabase

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.

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.

21.

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.

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.

22.

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.

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.

23.

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.

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.

24.

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

CREATE DATABASE

This CREATES a new database and a MESSAGE displays CREATE DATABASE which INDICATES that the creation of the database was successful.

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

CREATE DATABASE

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

25.

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.

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.

26.

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.

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.

27.

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.

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.

28.

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.

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.

29.

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.

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.

30.

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.

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.

31.

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.

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.

32.

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.

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.

33.

How To Check Whether Postgresql Server Is Up And Running?

Answer»
  1. /usr/local/etc/rc.d/010.pgsql.sh STATUS
  2. /usr/local/etc/rc.d/postgresql status?

34.

How To Stop The Database Server?

Answer»
  1. /usr/local/etc/rc.d/010.pgsql.sh STOP
  2. /usr/local/etc/rc.d/postgresql stop

35.

How To Start The Database Server?

Answer»
  1. /usr/local/etc/rc.d/010.pgsql.sh START
  2. /usr/local/etc/rc.d/postgresql start

36.

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.

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.

37.

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.

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.

38.

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.

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.

39.

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.

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.