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