My script inst/init-base didn't run

From: "lise chhay" <lise(dot)chhay(at)mail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: My script inst/init-base didn't run
Date: 2004-06-10 10:13:37
Message-ID: 20040610101337.4AAA91F4FEB@ws1-2.us4.outblaze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-admin by date

  From Date Subject
Next Message akuppachi 2004-06-10 10:27:53 Calculating size of the database tables
Previous Message lise chhay 2004-06-10 08:55:35 "select * from groupes" didn't display any data