Error:
[root@said extension]# su - postgres
Last login: Wed Dec 13 14:33:47 BDT 2017 on pts/1
-bash-4.2$ psql -U sors
psql (9.2.13, server 9.5.10)
WARNING: psql version 9.2, server version 9.5.
Some psql features might not work.
Type "help" for help.
sors=# CREATE EXTENSION tablefunc;
ERROR: could not open extension control file "/usr/pgsql-9.5/share/extension/tablefunc.control": No such file or directory
sors=# exit
sors-# \q
-bash-4.2$ exit
Reason:
postgresql95-contrib package is not installed or wrong version installed
The tablefunc module includes various functions that return tables (that is, multiple rows). These functions are useful both in their own right and as examples of how to write C functions that return multiple rows.
Solution:
[root@said extension]# ls -lrt
total 12
-rw-r--r--. 1 root root 381 Nov 8 23:31 plpgsql--unpackaged--1.0.sql
-rw-r--r--. 1 root root 179 Nov 8 23:31 plpgsql.control
-rw-r--r--. 1 root root 332 Nov 8 23:31 plpgsql--1.0.sql
[root@said extension]# pwd
root@said yum.repos.d]# yum install postgresql-contrib
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package postgresql95-contrib.x86_64 0:9.5.10-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
postgresql95-contrib x86_64 9.5.10-1PGDG.rhel7 pgdg95 533 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
.
Total download size: 533 k
Installed size: 1.8 M
Is this ok [y/d/N]: y
Downloading packages:
postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64.rpm | 533 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64 1/1
Verifying : postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64 1/1
Installed:
postgresql95-contrib.x86_64 0:9.5.10-1PGDG.rhel7
Complete!
[root@said yum.repos.d]# cd /usr/pgsql-9.5/share/extension/
[root@said extension]# ls -lrt
total 932
-rw-r--r--. 1 root root 394 Nov 8 23:31 timetravel--unpackaged--1.0.sql
-rw-r--r--. 1 root root 156 Nov 8 23:31 timetravel.control
-rw-r--r--. 1 root root 486 Nov 8 23:31 timetravel--1.0.sql
-rw-r--r--. 1 root root 134 Nov 8 23:31 tcn.control
-rw-r--r--. 1 root root 274 Nov 8 23:31 tcn--1.0.sql
-rw-r--r--. 1 root root 1160 Nov 8 23:31 tablefunc--unpackaged--1.0.sql
-rw-r--r--. 1 root root 174 Nov 8 23:31 tablefunc.control
-rw-r--r--. 1 root root 2153 Nov 8 23:31 tablefunc--1.0.sql
[root@said extension]# su - postgres
Last login: Wed Dec 13 14:55:33 BDT 2017 on pts/1
-bash-4.2$ psql -U sors sors -c "CREATE EXTENSION tablefunc"
CREATE EXTENSION
-bash-4.2$ pwd
/var/lib/pgsql
[root@said extension]# su - postgres
Last login: Wed Dec 13 14:33:47 BDT 2017 on pts/1
-bash-4.2$ psql -U sors
psql (9.2.13, server 9.5.10)
WARNING: psql version 9.2, server version 9.5.
Some psql features might not work.
Type "help" for help.
sors=# CREATE EXTENSION tablefunc;
ERROR: could not open extension control file "/usr/pgsql-9.5/share/extension/tablefunc.control": No such file or directory
sors=# exit
sors-# \q
-bash-4.2$ exit
Reason:
postgresql95-contrib package is not installed or wrong version installed
The tablefunc module includes various functions that return tables (that is, multiple rows). These functions are useful both in their own right and as examples of how to write C functions that return multiple rows.
Solution:
[root@said extension]# ls -lrt
total 12
-rw-r--r--. 1 root root 381 Nov 8 23:31 plpgsql--unpackaged--1.0.sql
-rw-r--r--. 1 root root 179 Nov 8 23:31 plpgsql.control
-rw-r--r--. 1 root root 332 Nov 8 23:31 plpgsql--1.0.sql
[root@said extension]# pwd
root@said yum.repos.d]# yum install postgresql-contrib
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package postgresql95-contrib.x86_64 0:9.5.10-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
postgresql95-contrib x86_64 9.5.10-1PGDG.rhel7 pgdg95 533 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
.
Total download size: 533 k
Installed size: 1.8 M
Is this ok [y/d/N]: y
Downloading packages:
postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64.rpm | 533 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64 1/1
Verifying : postgresql95-contrib-9.5.10-1PGDG.rhel7.x86_64 1/1
Installed:
postgresql95-contrib.x86_64 0:9.5.10-1PGDG.rhel7
Complete!
[root@said yum.repos.d]# cd /usr/pgsql-9.5/share/extension/
[root@said extension]# ls -lrt
total 932
-rw-r--r--. 1 root root 394 Nov 8 23:31 timetravel--unpackaged--1.0.sql
-rw-r--r--. 1 root root 156 Nov 8 23:31 timetravel.control
-rw-r--r--. 1 root root 486 Nov 8 23:31 timetravel--1.0.sql
-rw-r--r--. 1 root root 134 Nov 8 23:31 tcn.control
-rw-r--r--. 1 root root 274 Nov 8 23:31 tcn--1.0.sql
-rw-r--r--. 1 root root 1160 Nov 8 23:31 tablefunc--unpackaged--1.0.sql
-rw-r--r--. 1 root root 174 Nov 8 23:31 tablefunc.control
-rw-r--r--. 1 root root 2153 Nov 8 23:31 tablefunc--1.0.sql
[root@said extension]# su - postgres
Last login: Wed Dec 13 14:55:33 BDT 2017 on pts/1
-bash-4.2$ psql -U sors sors -c "CREATE EXTENSION tablefunc"
CREATE EXTENSION
-bash-4.2$ pwd
/var/lib/pgsql