pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
start postgresql8 with -o "-i" option
4+ messages / 4 participants
[nested] [flat]

* start postgresql8 with -o "-i" option
@ 2005-07-29 06:06  王晓华 <jacob.xiaohua@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: 王晓华 @ 2005-07-29 06:06 UTC (permalink / raw)
  To: 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!


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: start postgresql8 with -o "-i" option
@ 2005-07-29 13:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: 王晓华 <jacob.xiaohua@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2005-07-29 13:52 UTC (permalink / raw)
  To: 王晓华 <jacob.xiaohua@gmail.com>; +Cc: pgsql-admin

=?GB2312?B?zfXP/ruq?= <jacob.xiaohua@gmail.com> writes:
> /usr/local/pgsql/bin/postmaster -o "-i" -D /usr/local/pgsql/data 

That should be just
  /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data 

You seem to be confusing pg_ctl syntax with postmaster syntax.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: start postgresql8 with -o "-i" option
@ 2005-07-29 14:17  Guido Barosio <gbarosio@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Guido Barosio @ 2005-07-29 14:17 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: 王晓华 <jacob.xiaohua@gmail.com>; pgsql-admin

Thought that v8 started with default tcp availability.

G.

On 7/29/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> =?GB2312?B?zfXP/ruq?= <jacob.xiaohua@gmail.com> writes:
> > /usr/local/pgsql/bin/postmaster -o "-i" -D /usr/local/pgsql/data
> 
> That should be just
> /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data
> 
> You seem to be confusing pg_ctl syntax with postmaster syntax.
> 
> regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
> 



-- 
"Adopting the position that you are smarter than an automatic
optimization algorithm is generally a good way to achieve less
performance, not more" - Tom Lane.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: start postgresql8 with -o "-i" option
@ 2005-07-29 14:25  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Guido Barosio <gbarosio@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Bruce Momjian @ 2005-07-29 14:25 UTC (permalink / raw)
  To: Guido Barosio <gbarosio@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; 王晓华 <jacob.xiaohua@gmail.com>; pgsql-admin

Guido Barosio wrote:
> Thought that v8 started with default tcp availability.

It is _enabled_ by default for connections, but local clients don't use
tcp by default.

---------------------------------------------------------------------------


> 
> G.
> 
> On 7/29/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > 
> > =?GB2312?B?zfXP/ruq?= <jacob.xiaohua@gmail.com> writes:
> > > /usr/local/pgsql/bin/postmaster -o "-i" -D /usr/local/pgsql/data
> > 
> > That should be just
> > /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data
> > 
> > You seem to be confusing pg_ctl syntax with postmaster syntax.
> > 
> > regards, tom lane
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> > 
> 
> 
> 
> -- 
> "Adopting the position that you are smarter than an automatic
> optimization algorithm is generally a good way to achieve less
> performance, not more" - Tom Lane.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-07-29 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29 06:06 start postgresql8 with -o "-i" option 王晓华 <jacob.xiaohua@gmail.com>
2005-07-29 13:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-07-29 14:17   ` Guido Barosio <gbarosio@gmail.com>
2005-07-29 14:25     ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox