I changed the name of a table in my Postgres database, and also changed the name of the corresponding primary key sequence. INSERTs work fine on the DB side.
Unfortunately, Yii is still trying to use the old sequence name. Is there some catalog table in Postgres that still needs updating, or is there a cache somewhere that I don’t know about? I’ve been trying to track down where Yii sets the $sequenceName variable, but have been getting lost in the layers.
Haven’t studyed the postgres implementation in Yii… but as I see this… Yii does not need to know the sequence… as it’s a database job to insert the next value of such fields… but maybe I’m wrong…
As for cache… you can try to empty the "assets" and "runtime" folder, all cached/temporary files are there…
If you don’t solve this… post here the error you get with the stach trace… I will try to find where is the problem as I’m using postgres too on my job…
Exactly the same problem. I rename a table, sequence and all things linked to this table in order to have a coherency in naming. I have no problem to insert things using psql command in my shell, however yii gives me an error returns by DB such as the “old_name_id_seq” doesn’t exist. I don’t find from where it is. I searched in all my code and there is no more trace of the old_name table. I delete assets and runtime aswell…
I hit that some time ago. I don’t remember exactly, but maybe there is an assumption somewhere about naming the sequence after the column name.
Check the expression set as the default value for the PK in the table. If you use pgadmin3 also check it in psql to make sure, I remember that I saw a bug report in pgadmin3 about it.