Tag Archives: postgresql

Postgresql 9.5 and Red Hat Enterprise Linux 7.0

I used to use Postgresql 9.5 with Red Hat Enterprise Linux 6.6.

As quite a long time passed using them, I had change my server configuration. So, I tried to start using Postgresql 9.5 and Red Hat Enterprise Linux 7.0 . When started installing them, I found out that these completely new command set.  Here it goes,

wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
rpm -ivh pgdg-redhat95-9.5-3.noarch.rpm
yum install postgresql95-server.x86_64

Read more of this post

Advertisements

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

Installing PostgreSQL 9.2 contrib extension in RedHat Linux

I had a table view in PostgreSQL DB, which uses ‘crosstab‘ function.

But my PostgreSQL wouldn’t let me use it, as it requires some extensions.

Crosstab function requires ‘tablefunc‘ extension.

When I tried

CREATE EXTENSION tablefunc;

It gave me

ERROR: could not open extension control file “/usr/pgsql-9.2/share/extension/tablefunc.control”: No such file or directory

********** Error **********

ERROR: could not open extension control file “/usr/pgsql-9.2/share/extension/tablefunc.control”: No such file or directory
SQL state: 58P01

Read more of this post