Tue Feb 8 23:18:20 PST 2005
- Previous message: [Slony1-general] slony cant find PK composed of (date, text)
- Next message: [patch] Re: [Slony1-general] slony cant find PK composed of (date, text)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hmm, I think my PL/pgSQL is good enough to suggest a fix for that. The attached patch does a check before looking for a primary key to make sure that the table exists. I've given it some brief testing, and it seems to work. Please double-check before committing it. I also made an attempt to follow the coding style -- please explain where I went wrong so that I know what to do with future patches. :-) Hope this helps, Steve Simms -- Steve Simms <steve at deefs.net> http://www.deefs.net On Thu, 3 Feb 2005, Brian Hirt wrote: > it's because it's looking for public.public.euro_rates. I've been bitten by > this before too. > if you supply an invalid table name, you get the "has no primary key" > message, not a "table > foo doesn't exist" message > > --brian > > On Feb 3, 2005, at 7:34 AM, Hannu Krosing wrote: > >> It seems that if primary key is on fields of type (date, text) >> then slony cant find it: >> >> postgres at db1:~/replicator/accdb2$ ./01_add_table_to_new_set2.sh >> <stdin>:50: PGRES_FATAL_ERROR select >> "_accountdb_cluster".determineIdxnameUnique('public.public.euro_rates', >> NULL); - ERROR: Slony-I: table public.public.euro_rates has no primary >> key >> >> postgres at db1:~/replicator/accdb2$ psql accountdb >> Welcome to psql 7.4.5, the PostgreSQL interactive terminal. >> >> accountdb=# \d euro_rates >> Table "public.euro_rates" >> Column | Type | Modifiers >> -------------+----------------+----------- >> id_date | date | not null >> id_currency | text | not null >> rate | numeric(20,10) | >> Indexes: >> "euro_rates_pkey" primary key, btree (id_date, id_currency) >> >> Is it a known problem or is something wrong with my setup ? >> >> slony version is plain 1.0.5 >> >> ------------- >> Hannu >> >> >> _______________________________________________ >> Slony1-general mailing list >> Slony1-general at gborg.postgresql.org >> http://gborg.postgresql.org/mailman/listinfo/slony1-general >> >> > -------------------------------------------- > MobyGames > http://www.mobygames.com > The world's largest and most comprehensive > gaming database project > > _______________________________________________ > Slony1-general mailing list > Slony1-general at gborg.postgresql.org > http://gborg.postgresql.org/mailman/listinfo/slony1-general > -------------- next part -------------- Index: slony1_funcs.sql =================================================================== RCS file: /home/cvs/slony1-engine/src/backend/slony1_funcs.sql,v retrieving revision 1.1.1.1 diff -u -3 -r1.1.1.1 slony1_funcs.sql --- slony1_funcs.sql 31 Jan 2005 22:12:49 -0000 1.1.1.1 +++ slony1_funcs.sql 8 Feb 2005 23:09:36 -0000 @@ -4271,6 +4271,19 @@ v_idxrow record; begin -- + -- Ensure that the table exists + -- + if (select PGC.relname + from "pg_catalog".pg_class PGC, + "pg_catalog".pg_namespace PGN + where "pg_catalog".quote_ident(PGN.nspname) || ''.'' || + "pg_catalog".quote_ident(PGC.relname) = p_tab_fqname + and PGN.oid = PGC.relnamespace) is null then + raise exception ''Slony-I: table % does not exist'', + p_tab_fqname; + end if; + + -- -- Lookup the tables primary key or the specified unique index -- if p_idx_name isnull then
- Previous message: [Slony1-general] slony cant find PK composed of (date, text)
- Next message: [patch] Re: [Slony1-general] slony cant find PK composed of (date, text)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list