Showing posts with label postgresql. Show all posts
Showing posts with label postgresql. Show all posts

Tuesday, November 20, 2018

psql: FATAL: Ident authentication failed for user (Centos 7)

What's up?

In this article you will know how to fix this error:
psql: FATAL:  Ident authentication failed for user "username"
which happens when you try to connect as follows:
psql -U username -h 127.0.0.1 -d postgres

How to install/upgrade postgresql server from 9.2 to 9.6 on Centos 7

Hello!

This tutorial includes detailed steps on how to upgrade from old 9.2 postgresql server to new 9.6 postgresql server, with data migration. But you can also use this article if you want to install fresh 9.6 version - you just need to skip migration steps. You can also check this link for more information.

1. install PGDG RPM file for new postgresql server
sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
(for the list of all options, check this link: https://yum.postgresql.org/repopackages.php)

Friday, November 25, 2016

How to deploy Trac on Debian Jessie with uwsgi and nginx

Dear all,

Today I'm going to deploy one popular bug tracking tool, which is known as Trac. At first look you may ask: why is it looking so weird? Was it designed in early 90's? Well, yes, interface is very minimalistic. But on the other side it has own benefits - it's absolutely free, written in Python and open source.

Below we will deploy Trac on Debian Jessie with Postgresql, uwsgi and nginx.

As everywhere else, I'm going to stick to my scheme, which I find convenient. If you have any suggestions what can be done better, feel free to tell me in comments or by email.

Also I'm assuming that you know how to install uwsgi and nginx packages. I will only show their trac configuration files. But if you need more info, read how to build uwsgi from source.

Saturday, November 19, 2016

Migration from MySQL to Postgresql with Django is easy as 1-2-3

Hi guys,

Short story: I started learning Django few years ago and created my first django website using mysql database. Over time I realized how much more powerful Postgresql is. And yesterday I decided to migrate my website from mysql to posgresql. But the main question - how?

First google search gave me suggestion - dump mysql database, then convert it to posgresql compatible format using some scripts. Check this page if you're interested.

I started doing it, but there were always some errors, even after conversion. For example, this:
ERROR:  column "blabla" is of type boolean but expression is of type integer

Friday, June 17, 2016

pg_dump version mismatch - How to fix in CentOS 7

If you've encountered with this issue:

pg_dump: server version: 9.4.7; pg_dump version: 9.2.15
pg_dump: aborting because of server version mismatch

Then it means that the version on your local pg_dump tool is older that the version of the remote postgresql database.

In my case I had postgresql 9.2 running on CentOS 7 and I was trying to dump database out of remote postgresql 9.4. So the solution was to install 9.4 using postgresql repository instead of centos distro repository. Below you will find instructions that you need to do in order to fix this issue on CentOS.

1. Navigate to this link and choose necessary rpm:
http://yum.postgresql.org/repopackages.php#pg94

2. Install rpm
sudo rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm

3. Install 9.4:
sudo yum install postgresql94

4. Find necessary pg_dump location:
find / -name pg_dump -type f 2>/dev/null

5. Run newly installed pg_dump:
/usr/pgsql-9.4/bin/pg_dump -h {dbhost} -U {dbuser} {dbname} > {dbname}.sql

That's it :-D