You are on page 1of 10

6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

PostgreSQL Interview Questions,
PostgreSQL Interview Questions and Answers

PostgreSQL Interview Questions and Answers, PostgreSQL Interview


Questions and Answers Freshers, PostgreSQL Interview Questions and
Answers, PostgreSQL Interview Questions

Before getting on to the PostgreSQL interview questions, the student must know


that the PostgreSQL is a continuously varying eld which needs the students as well
as professionals to upgrade their skills with the new features and knowledge, to get
t for the jobs associated with PostgreSQL. This post related to
PostgreSQL Interview Questions and Answers, PostgreSQL Interview Questions
and Answers Freshers, PostgreSQL Interview Questions and Answers,
PostgreSQL Interview Questions will help you let out nd all the solutions that are
frequently asked in you upcoming PostgreSQL interview.

Over thousands of vacancies available for the PostgreSQL developers, experts must
be acquaintance with all the component of PostgreSQL technologies. This is
necessary for the students in order to have in-depth knowledge of the subject so that
they can have best employment opportunities in the future. Knowing every little
detail about PostgreSQL is the best approach to solve the problems linked with
problem.

APTRON has spent hours and hours in researching about the PostgreSQL Interview
Questions and Answers, PostgreSQL Interview Questions and Answers Freshers,

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 1/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

PostgreSQL Interview Questions and Answers, PostgreSQL Interview Questions


that you might encounter in your upcoming interview.  All these questions will alone
help you to crack the interview and make you the best among all your competitors.

First of all, let us tell you about how the PostgreSQL technology is evolving in today’s
world and how demanding it is in the upcoming years. In fact, according to one study,
most of the companies and businesses have moved to the PostgreSQL. Now, you
cannot predict how huge the future is going to be for the people experienced in the
related technologies.

Hence, if you are looking for boosting up your pro le and securing your future,
PostgreSQL will help you in reaching the zenith of your career. Apart from this, you
would also have a lot of opportunities as a fresher.

These questions alone are omnipotent. Read and re-read the questions and their
solutions to get accustomed to what you will be asked in the interview. These
PostgreSQL interview questions and answers will also help you on your way to
mastering the skills and will take you to the giant world where worldwide and local
businesses, huge or medium, are picking up the best and quality PostgreSQL
professionals.

This ultimate list of best PostgreSQL interview questions will ride you through the
quick knowledge of the subject and topics like Transactions and Concurrency,
Performance Tuning. This PostgreSQL interview questions and answers can be your
next gateway to your next job as a PostgreSQL expert.

These are very Basic PostgreSQL Interview Questions and Answers for freshers
and experienced both.

Q1: What Is Postgresql?

A1: 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.

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 2/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

Q2: State Some Of The Advanced Features Of Postgresql?

A2: 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 exible API
4) Procedural languages and MVCC
5) Client server and WAL.

Q3: Explain About Write Ahead Logging?

A3: 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.

Q4: Explain About Multi Version Concurrency Control?

A4: 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.

Q5: How to Start The Database Server?

A5:

/usr/local/etc/rc.d/010.pgsql.sh start
/usr/local/etc/rc.d/postgresql start

Q6: How To Stop The Database Server?

A6:

/usr/local/etc/rc.d/010.pgsql.sh stop
/usr/local/etc/rc.d/postgresql stop

Q7: How To Check Whether Postgresql Server Is Up And Running?

A7:
http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 3/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

/usr/local/etc/rc.d/010.pgsql.sh status
/usr/local/etc/rc.d/postgresql status?

Q8: What Are The Languages Which Postgresql Supports?

A8: 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.

Q9: Explain About The Command Enable Debug?

A9: 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 le
size. Debugging symbols are present which can assist developers in noticing bugs
and problems associated with their script.

Q10: Explain About Functions In Postgresql?

A10: Functions are important because they help the code to be executed on the
server. Some of the languages which can program functions for e cient 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.

Q11: What is maximum size of table in postgresql?

A11: The postgresql has maximum size of table is 32TB.

Q12: What is the option that can be used in PostgreSQL to make transactions see
rows a ected in previous parts of the transaction?(80% asked Postgresql Interview
Questions )

A12: The SQL standard de nes four levels of transaction isolation in terms of three
phenomena that must be prevented between concurrent transactions. These
undesirable phenomena are:

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 4/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

Dirty read
A transaction reads data written by a concurrent uncommitted transaction.

Nonrepeatable read
A transaction re-reads data it has previously read and nds that data has been
modi ed by another transaction (that committed since the initial read).

Phantom read
A transaction re-executes a query returning a set of rows that satisfy a search
condition and nds that the set of rows satisfying the condition has changed due to
another recently-committed transaction.

Q13: Explain Multi Version concurrency control.

A13: 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.

Q14: How the stats updated in Postgresql?

A14: To update statistics in PostgreSQL explicit ‘vacuum’ call is made. Hope you know
the method of doing this. If not let us know and we would help you.Vacuum with the
option Analyze is used to update statistics in Postgresql VACUUM ANALYZE ; is the
syntax.

Q15: What is write ahead logging in Postgresql?

A15: 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.

Q16: How to start database server in postgresql?

A16:
1. /usr/local/etc/rc.d/010.pgsql.sh start
2. /usr/local/etc/rc.d/postgresql start

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 5/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

Q17: How to stop database server in postgresql?

A17:
1. /usr/local/etc/rc.d/010.pgsql.sh stop
2. /usr/local/etc/rc.d/postgresql stop

Q18: How to change PostgreSQL root user password?

A18:
$ /usr/local/pgsql/bin/psql postgres postgres
Password: (oldpassword)
# ALTER USER postgres WITH PASSWORD ‘tmppassword’;

$ /usr/local/pgsql/bin/psql postgres postgres


Password: (tmppassword)

Changing the password for a normal postgres user is similar as changing the
password of the root user. Root user can change the password of any user, and the
normal users can only change their passwords as Unix way of doing.

# ALTER USER username WITH PASSWORD ‘tmppassword’;

Q19: How to setup PostgreSQL SysV startup script?

A19:
$ su – root

# tar xvfz postgresql-8.3.7.tar.gz

# cd postgresql-8.3.7

# cp contrib/start-scripts/linux /etc/rc.d/init.d/postgresql

# chmod a+x /etc/rc.d/init.d/postgresql

Q20: How to check whether PostgreSQL server is up and running?

A20:

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 6/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

$ /etc/init.d/postgresql status
Password:
pg_ctl: server is running (PID: 6171)
/usr/local/pgsql/bin/postgres “-D” “/usr/local/pgsql/data”
[Note: The status above indicates the server is up and running]

$ /etc/init.d/postgresql status
Password:
pg_ctl: no server running
[Note: The status above indicates the server is down]

Q21: How to start, stop and restart PostgreSQL database?

A21:
# service postgresql stop
Stopping PostgreSQL: server stopped
ok

# service postgresql start


Starting PostgreSQL: ok

# service postgresql restart


Restarting PostgreSQL: server stopped
ok

Q22: How to create a PostgreSQL Database?

A22:
There are two metods in which you can create two databases.

Method 1: Creating the database in the PSQL prompt, with createuser command.

# CREATE DATABASE mydb WITH OWNER ramesh;


CREATE DATABASE

Method 2: Creating the database in the shell prompt, with createdb command.

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 7/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

$ /usr/local/pgsql/bin/createdb mydb -O ramesh

CREATE DATABASE
* -O owner name is the option in the command line.

Q23: How do I get a list of databases in a Postgresql database?

A23:
# \l [Note: This is backslash followed by lower-case L]
List of databases
Name | Owner | Encoding
———-+———-+———-
backup | postgres | UTF8
mydb | ramesh | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8

Q24: How to Delete/Drop an existing PostgreSQL database?

A24:
# \l
List of databases
Name | Owner | Encoding
———-+———-+———-
backup | postgres | UTF8
mydb | ramesh | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8

# DROP DATABASE mydb;


DROP DATABASE

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 8/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

Q25: Getting help on postgreSQL commands

A25: \? will show PSQL command prompt help. \h CREATE will shows help about all
the commands that starts with CREATE, when you want something speci c such as
help for creating index, then you need to give CREATE INDEX.

# \?

# \h CREATE

# \h CREATE INDEX

PostgreSQL Conclusion Interview FAQs

We know the list of PostgreSQL Interview Questions and Answers, PostgreSQL


Interview Questions and Answers Freshers, PostgreSQL Interview Questions
and Answers, PostgreSQL Interview Questions is overwhelming but the
advantages of reading all the questions will maximize your potential and help you
crack the interview. The surprising fact is that this PostgreSQL interview questions
and answers post covers all the basic of the PostgreSQL technology and you have to
check out the FAQs of di erent components of PostgreSQL too.

However, you will be asked with the questions in the interview related to the above
mentioned questions. Preparing and understanding all the concept of PostgreSQL
technology will help you strengthen the other little information around the topic.

After preparing these interview questions, we recommend you to go for a mock


interview before facing the real one. You can take the help of your friend or a
PostgreSQL expert to nd the loop holes in your skills and knowledge. Moreover, this
will also allow you in practicing and improving the communication skill which plays a
vital role in getting placed and grabbing high salaries.

Remember, in the interview, the company or the business or you can say the
examiner often checks your basic knowledge of the subject. If your basics is covered
and strengthened, you can have the job of your dream. The industry experts

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 9/10
6/4/2018 PostgreSQL Interview Questions | Freshers | Experienced | PostgreSQL Interview Questions and Answers

understand that if the foundation of the student is already made up, it is easy for the
company to educate the employ towards advance skills. If there are no basics, there
is no meaning of having learnt the subject.

Therefore, it’s never too late to edge all the basics of any technology. If you think that
you’ve not acquired the enough skills, you can join our upcoming batch of
PostgreSQL Training in Noida. We are one of the best institute for PostgreSQL in
noida which provide advance learning in the eld of PostgreSQL Course. We’ve highly
quali ed professionals working with us and promise top quality education to the
students.

We hope that you enjoyed reading PostgreSQL Interview Questions and Answers,


PostgreSQL Interview Questions and Answers Freshers, PostgreSQL Interview
Questions and Answers, PostgreSQL Interview Questions and all the FAQs
associated with the interview. Do not forget to revise all the PostgreSQL interview
questions and answers before going for the PostgreSQL interview. In addition to this,
if you’ve any doubt or query associated with PostgreSQL, you can contact us anytime.
We will be happy to help you out at our earliest convenience. At last, we wish you all
the best for your upcoming interview on PostgreSQL Technology.

http://aptronnoida.in/iqa/best-postgresql-interview-questions-answers/ 10/10

You might also like