Advertisement:

Author Topic: Having problems using postgresql .  (Read 15397 times)

Offline gamey

  • Newbie
  • *
  • Posts: 6
Having problems using postgresql .
« on: July 29, 2014, 03:24:53 AM »
I've used mysql/mariadb plenty in the past but I've almost never used postgres.  My VPS has mysql installed, but I have reason to believe the tables may have some sort of consistency issue so I installed postgres.

Now I suspect I have setup postgres properly but it still isn't working.  I have a superuser account with a password, but the install.php keeps telling me invalid username.  How do I even know it is trying to connect to postgres instead of mysql?  Maybe I should turn off the mysql server and see ?  Too bad /etc/init.d/mysql stop doesn't work...

edit - Ok, I removed the mysql entry in the array from install.php.  I then had to apt-get install php5-pg or something.  So now it just won't authenticate with postgres.  Is there a simple list of commands how to create the user properly for postgres ?

edit2 - So I tried creating a 2nd account and this is what I get
Critical Error!
Cannot connect to the database server with the supplied data.

If you are not sure about what to type in, please contact your host.
« Last Edit: July 29, 2014, 04:03:08 AM by gamey »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Having problems using postgresql .
« Reply #1 on: July 29, 2014, 04:22:37 AM »
That sort of implies that the credentials are wrong. I know there's historically been issues with connecting on non-default ports.

However, I would also note that MySQL is not only the original database for which everything was built in 1.1.x (and thus 2.0 is a superset), it's the reference implementation across all platforms, and PostgreSQL has never really had the time spent with it for debugging and optimisation that MySQL has had.

I would honestly suggest finding out what the problems with MySQL are rather than trying to switch to PostgreSQL, if nothing else because there are so many more people that have the skills to help.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline gamey

  • Newbie
  • *
  • Posts: 6
Re: Having problems using postgresql .
« Reply #2 on: July 29, 2014, 04:54:25 AM »
That sort of implies that the credentials are wrong. I know there's historically been issues with connecting on non-default ports.

However, I would also note that MySQL is not only the original database for which everything was built in 1.1.x (and thus 2.0 is a superset), it's the reference implementation across all platforms, and PostgreSQL has never really had the time spent with it for debugging and optimisation that MySQL has had.

I would honestly suggest finding out what the problems with MySQL are rather than trying to switch to PostgreSQL, if nothing else because there are so many more people that have the skills to help.

Understood and thank you for your thoughtful reply.  I basically have an application using mysql on the vps that is waiting for me to have time to set it back up.  It is using old  mysql binary files that I copied in place which works but gives errors.  That application works enough for my needs, but I don't want to start a new smf instance off of what might be a broken mysql install just to have issues later.  I also don't want to reinstall the other app elsewhere. 

I have noticed that SMF doesn't really have much discussion about postgresql except to say that it is supported.  Sigh.  Yea, it does seem to be a credential problem...  I was hoping there was a wiki/doc somewhere that talked about the basic steps to get postgres going...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Having problems using postgresql .
« Reply #3 on: July 29, 2014, 05:11:15 AM »
That's because it's only just supported, even to the point of the abstraction layer just taking MySQL queries and hammering them to fit PostgreSQL syntax.

I understand your frustrations but I would still encourage identifying the fault with MySQL before trying to isolate the fault with SMF/PostgreSQL.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Having problems using postgresql .
« Reply #4 on: July 30, 2014, 04:16:15 PM »
Like Arantor, I would also recommend figuring out what's going on with MySQL instead of trying to blindly switch to another database system that you know absolutely nothing about. Did you actually give this user access to the database? If so, try connecting to the database as that use from the shell (psql -U username -W password database) and see what error it gives you. If not, see http://www.postgresql.org/docs/current/static/sql-alterrole.html for info on how to do so.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org