A table can have only one primary key column.
After a PostgreSQL installation, how will you create the database cluster?
With createdb 0%
With initdb 0%
With createdbs 0%
With postmaster 0%
None of the above 0%
An ISO-8601 time may be entered into a table using the numeric format 012411 instead of 01:24:11.
Are the contents of the pg_autovacuum system catalog saved when pg_dumpall is used to backup the database?
Can deferrable constraints be deferred by a trigger?
Consider the following empty table: CREATE TABLE example ( a integer, b integer, c integer, UNIQUE (a, c) ); Which of the following inserts will cause an error?
insert into example (a, b, c) values (1, 2, 3), (1, 2, 4); 0%
insert into example (a, b, c) values (1, 2, 3), (3, 3, 3); 0%
insert into example (a, b, c) values (1, 1, 1), (3, 3, 3); 0%
insert into example (a, b, c) values (1, 2, 3), (1, 4, 3); 0%
None will cause an error 0%
Consider the following query: Create table foo (bar varchar); What will be the size limit of the bar?
256 0%
1024 0%
1 0%
No limit (It will be equivalent to the text) 0%
None of the above 0%
Does PostgreSQL support SSL?
For proper results, which of the following should contain a tsvector?
Lexemes 0%
Tokens 0%
Integers 0%
Sets 0%
Enum 0%
Given a table special_products that inherits from a table store_products, which of the following statements will modify store_products only without affecting its child table?
UPDATE store_products ONLY SET name = 'Wine' WHERE id = 2; 0%
UPDATE store_products SET name= 'Wine' WHERE id = 2; 0%
UPDATE ONLY store_products SET name = 'Wine' WHERE id = 2; 0%
UPDATE JUST store_products SET name = 'Wine' WHERE id = 2; 0%
UPDATE store_products NOT special_products SET name = 'Wine' WHERE id = 2; 0%
How can you configure PostgreSQL autovacuum?
With the ALTER autovacuum policy; query in psql 0%
By editing pg_hba.conf 0%
By editing postgresql.conf 0%
By running the autovacuum command line tool 0%
None of the above 0%
How do you alter a column to forbid null values?
alter table foo alter bar set not null; 0%
alter table foo alter bar avoid null; 0%
alter table foo alter bar forbid null; 0%
alter table foo alter bar add not null; 0%
None of the above 0%
How do you create a table with a field of the int array type?
create table foo (bar int array); 0%
create table foo (bar integer[]); 0%
create table foo (bar array int); 0%
create table foo (bar[] int); 0%
None of the above 0%
How do you select a single random row from a table?
SELECT random() * FROM tab LIMIT 1; 0%
SELECT * FROM tab ORDER BY random() LIMIT 1; 0%
SELECT * FROM tab RANDOM LIMIT 1 ; 0%
SELECT RANDOM 1 from tab; 0%
None of the above 0%
How will you change the TCP port which PostgreSQL will listen to?
PostgreSQL does not support TCP 0%
By changing "port" in postgresql.conf 0%
By issuing UPDATE config SET port = <newvalue> 0%
TCP port cannot be changed 0%
None of the above 0%
How will you list the available functions from psql?
select * from pg_functions; 0%
df 0%
? functions 0%
select * from pg_procedures; 0%
None of the above 0%
How will you rank text search results?
With the ORDER BY operator 0%
With the ts_rank function 0%
Search results are automatically ranked 0%
Search results cannot be ranked 0%
None of the above 0%
If max_connections is 10 and 10 connections are currently active, how can you be sure the superuser will be available to connect?
You cannot 0%
Leave a superuser connected all the time 0%
Set superuser_reserved_connections in postgresql.conf 0%
Kill postmaster and connect to it 0%
None of the above 0%
In the following list, which operators do a case insensitive string matching?
LIKE 0%
ILIKE 0%
~ 0%
~* 0%
None of the above 0%
In the following operation, which ones can trigger a trigger?
alter 0%
insert 0%
drop 0%
update 0%
delete 0%
On a UNIX system, what is the best way to prevent all non-local connections to the postmaster?
Using ipfilter 0%
Using UNIX sockets 0%
Using TCP port 0 0%
Using an empty pg_hba.conf 0%
None of the above 0%
Out of the following backup approaches, which ones are applicable to PostgreSQL?
SQL dump 0%
File system level backup 0%
Real cluster 0%
Continuous archiving 0%
None of the above 0%
PostgreSQL triggers can be written in C directly.
SELECT !!3; What output will this statement give?
true 0%
3 0%
6 0%
The statement is invalid. 0%
None of the above. 0%
SELECT 'infinity'::timestamp; Will this statement produce an error?
SELECT rtrim('foobar', 'abr'); The result of this statement is foo.
The following statement will retrieve the second element of the array column products in table store_products. SELECT products[1] FROM store_products;
To backup a database, the postmaster daemon must be halted.
What can be stored in a column of type decimal(4,3)?
4 numeric values with up to 3 digits to the right of the decimal point. 0%
A numeric value with up to 7 digits in total, 3 of which can be to the right of the decimal point. 0%
A numeric value with up to 4 digits in total, 3 of which can be to the right of the decimal point. 0%
A numeric value with at least 4 digits, 3 of which must be to the right of the decimal point. 0%
What command will correctly restore a backup made with the following command? pg_dump -Fc dbname > filename
psql -f filename dbname 0%
psql -Fc filename dbname 0%
pg_restore filename dbname 0%
pg_restore -d dbname filename 0%
None of the above 0%
What interfaces are available in the base distribution of PostgreSQL?
Java 0%
PHP 0%
C 0%
Ruby 0%
Perl 0%
What is the ~ operator?
POSIX regular expression match operator 0%
XOR operator 0%
NOT operator 0%
Home directory ENV variable 0%
None of the above 0%
What is the command used to import a backup made with pg_dumpall > file.dmp?
pg_restore file.dmp 0%
psql -f file.dmp 0%
pg_restoreall file.dmp 0%
postgre --restore -f file.dmp 0%
None of the above 0%
What is the default ordering when ORDER BY is not specified?
By ID 0%
By insertion date 0%
By name 0%
The ordering is unknown if not specified 0%
None of the above 0%
What is the difference between to_tsvector() and ::tsvector ?
to_tsvector () normalizes the string while ::tsvector does not 0%
to_tsvector () can be used in select statements, while ::tsvector cannot 0%
They are equivalent 0%
None of the above 0%
What is the difference between tokens and lexemes?
Tokens are always in upper case 0%
Lexemes are normalized 0%
A lexeme is a string while a token is an integer 0%
Lexemes are always in upper case 0%
None of the above 0%
What is the effect of turning fsync off in postgresql.conf?
File synchronization will be deactivated 0%
fsync is not a valid configuration option 0%
PostgreSQL will not enforce write ahead log flush 0%
It will turn off fast synchronization 0%
None of the above 0%
What is the name of the special time input with value 00:00:00.00 UTC?
zero 0%
noon 0%
midnight 0%
allballs 0%
None of the above 0%
What is the storage size of an integer on a 64bit system?
8bytes 0%
2bytes 0%
16bytes 0%
4bytes 0%
64bytes 0%
What is the well known port number for the postgresql database service?
5000 0%
541 0%
5432 0%
63 0%
None of the above 0%
What is true regarding file system backup?
It can only be used to backup the whole database 0%
The database must be running for the backup to take place 0%
To restore a file system backup, pg_restore should be used 0%
None of the above 0%
All of the above 0%
What kind of triggers are offered by PostgreSQL?
Per-row triggers 0%
Per-table triggers 0%
Per-database triggers 0%
Per-statement triggers 0%
What library is used by PostgreSQL for encryption?
GnuTLS 0%
OpenSSL 0%
OpenLDAP 0%
OpenTLS 0%
None of the above 0%
When using LIKE to compare strings, what is the wildcard operator (operator which matches zero or more characters)?
* 0%
$ 0%
% 0%
& 0%
None of the above 0%
Which authentication methods are supported by PostgreSQL?
Trust 0%
PAM 0%
LDAP 0%
Radius 0%
Password 0%
Which function should be used to highlight the results?
ts_highlight 0%
ts_tag 0%
ts_headline 0%
ts_select 0%
None of the above 0%
Which index types are supported by PostgreSQL?
A-tree 0%
B-tree 0%
GiST 0%
Hash 0%
GIN 0%
None of the above 0%
Which index types support multicolumn indexes?
B-tree 0%
GiST 0%
GIN 0%
Hash 0%
None of the above 0%
Which kind of index can be declared unique?
Hash 0%
A-tree 0%
B-tree 0%
GIN 0%
GiST 0%
Which of the following queries will create a table with two fields, "id" and "name" with "id" as an auto incrementing primary key?
create table foo (id int serial primary key auto, name varchar(255)); 0%
create table foo (id int auto_increment primary key, name varchar(255)); 0%
create table foo (id auto_increment primary key, name varchar(255)); 0%
create table foo (id serial primary key, name varchar(255)); 0%
None of the above 0%
Which of the following statements will cast the integer value 1 to type text?
SELECT text(1) AS cast_integer; 0%
SELECT CAST(1, text) as cast_integer; 0%
SELECT 1::text AS cast_integer; 0%
SELECT 1 TO text AS cast_integer; 0%
SELECT CAST(1 AS text) AS cast_integer; 0%
Which of the following statements will create a table special_products which is a child of the table store_products?
CREATE TABLE special_products (quality int) INHERITS store_products; 0%
CREATE TABLE special_products (quality int) EXTENDS store_products; 0%
CREATE TABLE special_products (quality int) EXPANDS store_products; 0%
CREATE TABLE special_products (quality int) FROM store_products; 0%
CREATE TABLE special_products (quality int) WITH PARENT store_products; 0%
Which of the following statements will create a table with a multidimensional array as second column?
CREATE TABLE favorite_books (customer_id integer, themes_and_titles text[[]]); 0%
CREATE TABLE favorite_books (customer_id integer, themes_and_titles text[][]); 0%
CREATE TABLE favorite_books (customer_id integer, themes_and_titles text{2}); 0%
CREATE TABLE favorite_books (customer_id integer, themes_and_titles text[text]); 0%
Which of the following statements will create a table?
SELECT INTO products_backup FROM special_products; 0%
SELECT FROM special_products * INTO products_backup; 0%
SELECT * INTO products_backup LIKE special_products; 0%
SELECT * INTO products_backup FROM special_products; 0%
SELECT COPY special_products INTO products_backup; 0%
Which of the following statements will produce an error?
SELECT now()::timestamp; 0%
SELECT now()::int; 0%
SELECT now()::varchar; 0%
SELECT now()::char; 0%
None 0%
Which of the following statements will retrieve the number of values stored in an array column?
SELECT array_dims(products) FROM store_products; 0%
SELECT products[] FROM store_products; 0%
SELECT dimensions(products) FROM store_products; 0%
SELECT array_dim(products) FROM store_products; 0%
SELECT count(products) FROM store_products; 0%
Which one of the following text search functions does not exist?
to_tsvector 0%
plainto_tsquery 0%
to_tsquery 0%
strip 0%
ts_rewrite 0%
plainto_tsvector 0%
Which PostgreSQL version added the enum datatype?
8.0 0%
8.1 0%
7.4 0%
8.3 0%
PostgreSQL doesn't have an enum type. 0%
While creating a table with a field of the serial type, a sequence will be created.
While creating a trigger, the function it will call may be created after it and attached to it.