My script inst/init-base didn't run - Mailing list pgsql-admin

From lise chhay
Subject My script inst/init-base didn't run
Date
Msg-id 20040610101337.4AAA91F4FEB@ws1-2.us4.outblaze.com
Whole thread Raw
List pgsql-admin
 I executed the script inst/creer-base, the script run, because when I did :
 $ psql auth
 auth=# \dt
 List of relations
 Schema   |  name           |    Type    |   Owner
 -------------------------------------------------
 public   | config          |   table    | postgres
 public   | groupes         |  table     | postgres
 public   | membres         |  table     | postgres
 public   | utilisateurs    |  table     | postgres

 auth=# \q

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

The content of my script inst/init-base is :

PGPASSWORD=postgres
export PGPASSWORD

BASE=auth

psql -q $BASE <<'EOF'

    INSERT INTO groupes (groupe, descr)
                VALUES ('postgres', 'Administrateurs de la base Auth') ;

    -- mot de passe = "a-changer"
    INSERT INTO utilisateurs (login, password, nom, prenom)
                VALUES ('postgres', 'postgres', '$1$qYOi/u4K$J0hEbJMRy2KmZP/yjl2Te/', 'postgres') ;

    INSERT INTO membres (login, groupe)
                VALUES ('postgres', 'postgres') ;

EOF

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

My script inst/init-base didn't run, it has given the following errors :
ERROR: duplicate key violates unique constraint "groupes_pkey"
ERROR: function soundex(text) does not exist
HINT:  No function matches the given name and argument types. You may need to add explicit type casts.
CONTEXT:  PL/pgSQL function "ajouter_soundex" line 2 at assignment
ERROR:  insert or update on table "membres" violates foreign key constraint "$1"
DETAIL:  Key (login)=(postgres) is not present in table "utilisateurs".

I've the program soundex.sql which contains the function CREATE FUNCTION soundex (TEXT) RETURNS TEXT AS.
If I must  execute the program soundex.sql, can you tell me how to execute the program soundex.sql, please.

Can you explain me for all these errors, please.
Thanks
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


pgsql-admin by date:

Previous
From: "lise chhay"
Date:
Subject: "select * from groupes" didn't display any data
Next
From: akuppachi@hss.hns.com
Date:
Subject: Calculating size of the database tables