[prev] 20 [next]

Exercise 2: Extracting a Schema

Write a PLpgSQL function:
  • function schema() returns setof text
  • giving a list of table schemas in the public schema

It should behave as follows:

db=# select * from schema();
            tables
---------------------------
 table1(x, y, z)
 table2(a, b)
 table3(id, name, address)
...