Wed Aug 19 07:31:48 PDT 2009
- Previous message: [Slony1-general] Error while Inserting into table
- Next message: [Slony1-general] Error while Inserting into table
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sweta Mulgavker wrote:
>
> Hello all,
>
> When I try to insert values in a table... slony is givng me the following
> error
>
> cars=# INSERT INTO t_emp_leave VALUES ('12-09-2009',1908,'presonal','f');
> ERROR: relation with OID 536225 does not exist
> CONTEXT: SQL statement "SELECT last_value::int4 FROM
> _replcluster.sl_log_status"
>
> What is this error....????
>
I've had this happen when I dropped and recreated the table on the slave,
thinking that was ok to do. The problem is that Slony stores the Postgres
OID, and uses that to find the table. If you drop and recreate a table, it
will have a new OID, and the value Slony has will no longer exist -- hence
the error.
To see if this is the case, do this on the slave node:
select * from _repcluster.sl_table where tab_relname='t_emp_leave';
Look at the tab_reloid value.
select oid from pg_class where relname='t_emp_leave';
Do the values match? If not, that's the problem.
I don't know what the official way to fix this is. I actually fixed it by
updating sl_table manually, but proceed at your own risk :-) I can't swear
to it, but I'm pretty sure I just did this. I figured it couldn't make
things worse.
update _repcluster.sl_table set tab_reloid=<real_oid> where
tab_relname='t_emp_leave';
The way to prevent is never drop and recreate replicated tables without
first removing them from the set.
Hope this helps.
--
View this message in context: http://www.nabble.com/Error-while-Inserting-into-table-tp25038554p25045264.html
Sent from the Slony-I -- General mailing list archive at Nabble.com.
- Previous message: [Slony1-general] Error while Inserting into table
- Next message: [Slony1-general] Error while Inserting into table
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list