Installation on non-standart port PostgreSQL

Having trouble installing serendipity?
Post Reply
mef
Regular
Posts: 13
Joined: Sat Jun 17, 2006 6:58 pm

Installation on non-standart port PostgreSQL

Post by mef »

Hello, I have a PostgreSQL database, opened on port 5417 (it is regular situation with database providers).
A did not find any fields in istallation form, where I can sign this port. How I can sign it to compleet using Serendipity?
Thank you.
jhermanns
Site Admin
Posts: 378
Joined: Tue Apr 01, 2003 11:28 pm
Location: Berlin, Germany
Contact:

Post by jhermanns »

try using :5417 after the hostname?
mef
Regular
Posts: 13
Joined: Sat Jun 17, 2006 6:58 pm

Post by mef »

I just edit include/db/postgres.inc.php
:)
NicZak
Regular
Posts: 8
Joined: Thu Jan 11, 2007 8:19 pm

Post by NicZak »

I don't know PHP, what exactly did you change to specify a non-default port? I assume it would just be adding a port='5434' in the sprintf( line but I tried that and it didn't work, what am I missing?

Code: Select all


    $serendipity['dbConn'] = $function(
                               sprintf(
                                 '%sdbname=%s user=%s password=%s',
                                 strlen($serendipity['dbHost']) ? ('host=' . $serendipity['dbHost'] . ' ') : '',
                                 $serendipity['dbName'],
                                 $serendipity['dbUser'],
                                 $serendipity['dbPass']
                               )
                             );
mef
Regular
Posts: 13
Joined: Sat Jun 17, 2006 6:58 pm

Post by mef »

function serendipity_db_connect() {
global $serendipity;

if (isset($serendipity['dbPersistent']) && $serendipity['dbPersistent']) {
$function = 'pg_pconnect';
} else {
$function = 'pg_connect';
}

$serendipity['dbConn'] = $function(
sprintf(
'%sdbname=%s user=%s password=%s',
strlen($serendipity['dbHost']) ? ('host=' . $serendipity['dbHost'] . ' port = 5417 ') : '',
$serendipity['dbName'],
$serendipity['dbUser'],
$serendipity['dbPass']
)
);

return $serendipity['dbConn'];
}
NicZak
Regular
Posts: 8
Joined: Thu Jan 11, 2007 8:19 pm

Post by NicZak »

I appreciate the reply, unfortunately that didn't solve it meaning I have a bigger issue at hand. I think it may have something to do with the fact that I need to use psqld rather than psql for the command. Any thoughts on this one?
Post Reply