start postgresql8 with -o "-i" option

From: 王晓华 <jacob(dot)xiaohua(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: start postgresql8 with -o "-i" option
Date: 2005-07-29 06:06:57
Message-ID: ea037e17050728230612c76fe8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

hi,i want to start database which can accept tcp/ip connecttions,now
there is a question:
i start database with the command:
/usr/local/pgsql/bin/postmaster -o "-i" -D /usr/local/pgsql/data
and edit pg_hba.conf with adding the line :
host all all 127.0.0.1/32 trust
host rftDatabase globus 127.0.0.1 255.255.255.255 trust

and after that i cant use psql to connect the database,here is the message:
psql: FATAL: invalid command-line arguments for server process
HINT: Try "postgres --help" for more information.

but if i start with : /usr/local/pgsql/bin/postmaster -o -i -D
/usr/local/pgsql/data
then i can connet database psql command,
in two situation i cat connect database with the file:
String url="jdbc:postgresql://xiaohua/rftDatabase";
String user = "globus";
String password = "globus";
try
{
Class.forName("org.postgresql.Driver");
System.out.println("9999999999");
}
catch(Exception ex)
{
System.out.println("Sub ------------: " + ex);
}

the error message is that:
Unable to connect======================
org.postgresql.util.PSQLException: 连接尝试失败。
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:117)
at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.(Jdbc3Connection.java:24)
at org.postgresql.Driver.connect(Driver.java:235)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at TableDisplay.(TableDisplay.java:39)
at TableDisplay.main(TableDisplay.java:158)
Caused by: java.net.SocketException: Invalid argument or cannot assign
requested address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.(Socket.java:309)
at java.net.Socket.(Socket.java:124)
at org.postgresql.core.PGStream.(PGStream.java:58)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77)
... 9 more
Exception in thread "main" java.lang.NullPointerException
at TableDisplay.getTable(TableDisplay.java:69)
at TableDisplay.(TableDisplay.java:55)
at TableDisplay.main(TableDisplay.java:158)

the jdbc driver is rightly confirmed and the classpath is right.
this question exists for few days and how should do next?thaks for
your attention!

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message ararant 2005-07-29 06:30:23 PostgreSQL Installation
Previous Message Gregory Zelesnik 2005-07-28 18:53:39 Re: libpq.so.3 compatability problem still there for 8.0.3 installs