Thread

  1. RE: error "11"

    Rob Arnold <rob@cabrion.com> — 2000-12-22T12:57:56Z

    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
    
  2. Re: error "11"

    David Merrill <dmerrill@lupercalia.net> — 2000-12-22T13:44:22Z

    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
    
    
  3. constraint question

    mwaples@optusnet.com.au — 2000-12-31T21:12:38Z

    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
    
    
  4. Re: constraint question

    mwaples@optusnet.com.au — 2000-12-31T21:31:24Z

    "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
    
    
  5. Re: constraint question

    D. Duccini <duccini@backpack.com> — 2000-12-31T22:39:20Z

    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!"   
    -----------------------------------------------------------------------------
    
    
    
  6. Re: constraint question

    Tom Lane <tgl@sss.pgh.pa.us> — 2000-12-31T23:12:47Z

    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
    
    
  7. Re: constraint question

    Brett W. McCoy <bmccoy@chapelperilous.net> — 2000-12-31T23:48:17Z

    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!"