Thread: error "11"

error "11"

From
David Merrill
Date:
I am getting a strange error from psql:

psql: connectDBStart() -- connect() failed: Connection refused
    Is the postmaster running at 'localhost'
    and accepting connections on Unix socket '5432'?

Yes, the postmaster is running. I can run psql -l and get a list of my
databases just fine.

This is from the log file:

Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000
Terminating any active server processes...
Server processes were terminated at Thu Dec 21 16:45:54 2000
Reinitializing shared memory and semaphores
001221.16:45:54.490 [18540] DEBUG:  Data Base System is starting up at Thu Dec 21 16:45:54 2000
001221.16:45:54.490 [18540] DEBUG:  Data Base System was interrupted being in production at Thu Dec 21 16:45:47 2000
001221.16:45:54.497 [18540] DEBUG:  Data Base System is in production state at Thu Dec 21 16:45:54 2000
Smart Shutdown request at Thu Dec 21 16:47:28 2000
001221.16:47:28.607 [18632] DEBUG:  Data Base System shutting down at Thu Dec 21 16:47:28 2000
001221.16:47:28.614 [18632] DEBUG:  Data Base System shut down at Thu Dec 21 16:47:28 2000

Which I hope will shed some light on the problem.

I have not only restarted my postgresql service, I have rebooted the
machine just to make sure. And ruined my previously stellar uptime. :-)

--
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

To attempt an understanding of Muad'Dib without understanding his mortal
enemies, the Harkonnens, is to attempt seeing Truth without knowing Falsehood.
It is the attempt to see the Light without knowing Darkness. It cannot be.
        -- from "Manual of Muad'Dib" by the Princess Irulan

Re: error "11"

From
Tom Lane
Date:
David Merrill <dmerrill@lupercalia.net> writes:
> I am getting a strange error from psql:
> psql: connectDBStart() -- connect() failed: Connection refused
>     Is the postmaster running at 'localhost'
>     and accepting connections on Unix socket '5432'?

> Yes, the postmaster is running. I can run psql -l and get a list of my
> databases just fine.

Odd.  'Connection refused' is a kernel-level rejection, not the
postmaster's; the postmaster never saw this connection attempt.
So issues like which database you were connecting to or what username
you supplied shouldn't affect the behavior.  As long as you gave the
same hostname (or lack of one) and port number for both the psql -l and
the normal connection attempt, I'd expect both or neither to get this
error message.

It's possible you'd see this from a transient-overload problem, ie,
multiple processes trying to connect simultaneously, but that wouldn't
be very repeatable.

> This is from the log file:

> Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000

That looks like a backend crash, but it wouldn't be related to your
connection problem AFAICS.

            regards, tom lane

RE: error "11"

From
"Rob Arnold"
Date:
Need more info. How are your starting up? What options?  Connecting from
another machine?

The log you sent says that the system shutdown, started and then shut down
again.  According to the log the system is not running at all after Thu Dec
21 16:47:28 2000.

--rob


----------
From:  David Merrill [SMTP:dmerrill@lupercalia.net]
Sent:  Thursday, December 21, 2000 5:30 PM
To:  pgsql-novice@postgresql.org
Subject:  error "11"

I am getting a strange error from psql:

psql: connectDBStart() -- connect() failed: Connection refused
    Is the postmaster running at 'localhost'
    and accepting connections on Unix socket '5432'?

Yes, the postmaster is running. I can run psql -l and get a list of my
databases just fine.

This is from the log file:

Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000
Terminating any active server processes...
Server processes were terminated at Thu Dec 21 16:45:54 2000
Reinitializing shared memory and semaphores
001221.16:45:54.490 [18540] DEBUG:  Data Base System is starting up at Thu
Dec 21 16:45:54 2000
001221.16:45:54.490 [18540] DEBUG:  Data Base System was interrupted being
in production at Thu Dec 21 16:45:47 2000
001221.16:45:54.497 [18540] DEBUG:  Data Base System is in production state
at Thu Dec 21 16:45:54 2000
Smart Shutdown request at Thu Dec 21 16:47:28 2000
001221.16:47:28.607 [18632] DEBUG:  Data Base System shutting down at Thu
Dec 21 16:47:28 2000
001221.16:47:28.614 [18632] DEBUG:  Data Base System shut down at Thu Dec 21
16:47:28 2000

Which I hope will shed some light on the problem.

I have not only restarted my postgresql service, I have rebooted the
machine just to make sure. And ruined my previously stellar uptime. :-)

--
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

To attempt an understanding of Muad'Dib without understanding his mortal
enemies, the Harkonnens, is to attempt seeing Truth without knowing
Falsehood.
It is the attempt to see the Light without knowing Darkness. It cannot be.
        -- from "Manual of Muad'Dib" by the Princess Irulan

Attachment

Re: error "11"

From
Dave_Pfaltzgraff@patapsco.com
Date:



Dave Pfaltzgraff@PATAPSCO
12/22/2000 08:31 AM

The log entry:
>Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000

would indicate to me that you may have memory problems. I saw this on an older
machine that I was trying to compile the kernel. Through many tries and digging,
I found that signal 11 is generally indicative of a memory problem. I was
finally convinced when I replaced the memory and made sure that bus speed was
set accordingly and the problem went away.

Since you're in a different environment, your status may have a different
meaning. (YMMV)



Re: error "11"

From
David Merrill
Date:
On Fri, Dec 22, 2000 at 07:57:56AM -0500, Rob Arnold wrote:
> Need more info. How are your starting up? What options?  Connecting from
> another machine?

Sorry. I just don't know what might be important!

I am running everything locally, and my system was fine for days, then
this suddenly started. I made no configuration changes. In fact, from
the same virtual terminal I ran a sql script with

    psql -f createschema.sql

which ran fine. I then ran my next script in sequence, which inserts
some static data into some of the tables, and that script aborted. So
I doubt it is a configuration issue.

> The log you sent says that the system shutdown, started and then shut down
> again.  According to the log the system is not running at all after Thu Dec
> 21 16:47:28 2000.

I checked using "ps -A | grep postmaster" and it was running. Then I
ran ps again and postmaster is still running under the same pid.


> I am getting a strange error from psql:
>
> psql: connectDBStart() -- connect() failed: Connection refused
>     Is the postmaster running at 'localhost'
>     and accepting connections on Unix socket '5432'?
>
> Yes, the postmaster is running. I can run psql -l and get a list of my
> databases just fine.
>
> This is from the log file:
>
> Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000
> Terminating any active server processes...
> Server processes were terminated at Thu Dec 21 16:45:54 2000
> Reinitializing shared memory and semaphores
> 001221.16:45:54.490 [18540] DEBUG:  Data Base System is starting up at Thu
> Dec 21 16:45:54 2000
> 001221.16:45:54.490 [18540] DEBUG:  Data Base System was interrupted being
> in production at Thu Dec 21 16:45:47 2000
> 001221.16:45:54.497 [18540] DEBUG:  Data Base System is in production state
> at Thu Dec 21 16:45:54 2000
> Smart Shutdown request at Thu Dec 21 16:47:28 2000
> 001221.16:47:28.607 [18632] DEBUG:  Data Base System shutting down at Thu
> Dec 21 16:47:28 2000
> 001221.16:47:28.614 [18632] DEBUG:  Data Base System shut down at Thu Dec 21
> 16:47:28 2000
>
> Which I hope will shed some light on the problem.
>
> I have not only restarted my postgresql service, I have rebooted the
> machine just to make sure. And ruined my previously stellar uptime. :-)
>
> --
> Dr. David C. Merrill                     http://www.lupercalia.net
> Linux Documentation Project                dmerrill@lupercalia.net
> Collection Editor & Coordinator            http://www.linuxdoc.org
>                                        Finger me for my public key
>
> To attempt an understanding of Muad'Dib without understanding his mortal
> enemies, the Harkonnens, is to attempt seeing Truth without knowing
> Falsehood.
> It is the attempt to see the Light without knowing Darkness. It cannot be.
>         -- from "Manual of Muad'Dib" by the Princess Irulan



--
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

Mine is the secret
That opens upon the door of youth,
And Mine is the cup of wine of life,
That is the Cauldron of Ceridwen
That is the holy grail of immortality.
        -- from The Charge of the Goddess, Doreen Valiente

Re: error "11"

From
David Merrill
Date:
On Thu, Dec 21, 2000 at 05:30:16PM -0500, David Merrill wrote:
> I am getting a strange error from psql:
>
> psql: connectDBStart() -- connect() failed: Connection refused
>     Is the postmaster running at 'localhost'
>     and accepting connections on Unix socket '5432'?
>
> Yes, the postmaster is running. I can run psql -l and get a list of my
> databases just fine.
>
> This is from the log file:
>
> Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000
> Terminating any active server processes...
> Server processes were terminated at Thu Dec 21 16:45:54 2000
> Reinitializing shared memory and semaphores
> 001221.16:45:54.490 [18540] DEBUG:  Data Base System is starting up at Thu Dec 21 16:45:54 2000
> 001221.16:45:54.490 [18540] DEBUG:  Data Base System was interrupted being in production at Thu Dec 21 16:45:47 2000
> 001221.16:45:54.497 [18540] DEBUG:  Data Base System is in production state at Thu Dec 21 16:45:54 2000
> Smart Shutdown request at Thu Dec 21 16:47:28 2000
> 001221.16:47:28.607 [18632] DEBUG:  Data Base System shutting down at Thu Dec 21 16:47:28 2000
> 001221.16:47:28.614 [18632] DEBUG:  Data Base System shut down at Thu Dec 21 16:47:28 2000
>
> Which I hope will shed some light on the problem.
>
> I have not only restarted my postgresql service, I have rebooted the
> machine just to make sure. And ruined my previously stellar uptime. :-)

I have some more information this morning.

I tried creating and working with a new database, and it works fine.
psql -l does not show my old database, but when I try to create it, I
get the message

createdb gnc_db<enter>

ERROR:  CREATE DATABASE: unable to create database directory
'/var/lib/pgsql/data/base/gnc_db': File exists
createdb: database creation failed

so it now looks to me like a partially deleted database is still
hanging around. I am afraid to go deleting anything. And there is
a gnc_db directory where the error message indicates.

Any advice on how I might proceed? What will happen if I delete that
directory?

--
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

From your silence, you will sing.
From your burdens, grow your wings.

Re: error "11"

From
Nabil Sayegh
Date:
Dave_Pfaltzgraff@patapsco.com wrote:

> >Server process (pid 18539) exited with status 11 at Thu Dec 21 16:45:54 2000
>
> would indicate to me that you may have memory problems. I saw this on an older
> machine that I was trying to compile the kernel. Through many tries and digging,
> I found that signal 11 is generally indicative of a memory problem. I was

AFAIK status 11 != signal 11

P.S.: But you are right that signal 11 could be a hardware problem.

cu
--
 Nabil Sayegh

constraint question

From
mwaples@optusnet.com.au
Date:
I have table users with a varchar field user_name,
Id like to restrict this to just alphanumeric characters
can I do this with a check constraint ?
or do I need to use a tigger and function ?

I've read the docs but can't seem to get it right - Im sure its fairly
simple and Id like to use it on a number of fields in a number of tables

Re: constraint question

From
"D. Duccini"
Date:
what language are you using?  might be easier to perform the check
programatically and provide thoughtful feedback at that level as opposed
to a db constraint

just suggestion

On Mon, 1 Jan 2001 mwaples@optusnet.com.au wrote:

> I have table users with a varchar field user_name,
> Id like to restrict this to just alphanumeric characters
> can I do this with a check constraint ?
> or do I need to use a tigger and function ?
>
> I've read the docs but can't seem to get it right - Im sure its fairly
> simple and Id like to use it on a number of fields in a number of tables
>


-----------------------------------------------------------------------------
david@backpack.com            BackPack Software, Inc.        www.backpack.com
+1 651.645.7550 voice       "Life is an Adventure.
+1 651.645.9798 fax            Don't forget your BackPack!"
-----------------------------------------------------------------------------


Re: constraint question

From
mwaples@optusnet.com.au
Date:
"D. Duccini" wrote:
>
> what language are you using?

Im using php/web interface to enter the data - I'ts easy enough to
restrict whats entered that way using ereg etc- but occasionaly I find
it quicker/easier to just do stuff by isql and so wanted to try and
restrict it at the database level -
it's not absolutely neccessary - I as more interested in knowing how to
do it.


 might be easier to perform the check
> programatically and provide thoughtful feedback at that level as opposed
> to a db constraint
>
> just suggestion
>
> On Mon, 1 Jan 2001 mwaples@optusnet.com.au wrote:
>
> > I have table users with a varchar field user_name,
> > Id like to restrict this to just alphanumeric characters
> > can I do this with a check constraint ?
> > or do I need to use a tigger and function ?
> >
> > I've read the docs but can't seem to get it right - Im sure its fairly
> > simple and Id like to use it on a number of fields in a number of tables

Re: constraint question

From
Tom Lane
Date:
mwaples@optusnet.com.au writes:
> I have table users with a varchar field user_name,
> Id like to restrict this to just alphanumeric characters
> can I do this with a check constraint ?

Sure, use a regexp pattern match, eg

regression=# create table fooey (f1 text check (f1 ~ '^[A-Za-z0-9]*$'));
CREATE
regression=# insert into fooey values('zzz33');
INSERT 145186 1
regression=# insert into fooey values('zzz 33');
ERROR:  ExecAppend: rejected due to CHECK constraint fooey_f1
regression=#

The pattern match operators are not very well documented in the 7.0
docs, but see
http://www.postgresql.org/devel-corner/docs/postgres/functions-matching.htm

            regards, tom lane

Re: constraint question

From
"Brett W. McCoy"
Date:
On Mon, 1 Jan 2001 mwaples@optusnet.com.au wrote:

> I have table users with a varchar field user_name,
> Id like to restrict this to just alphanumeric characters
> can I do this with a check constraint ?
> or do I need to use a tigger and function ?

Use a regular expression in your check constraint:

create table reg_test (
        id integer primary key,
        descr varchar(20),
        check (descr ~* '^[A-Z0-9]*$')
);

insert into reg_test values (1, 'data\&');
ERROR:  ExecAppend: rejected due to CHECK constraint $1

-- Brett
                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
Feeling amorous, she looked under the sheets and cried, "Oh, no,
it's Microsoft!"