PostgreSQL + Yii 1.1: wrong schema in default sequence (pg_attrdef)

Viewed 19

Im setting my sequence in my column like this:

ALTER TABLE legacy.sys_pessoa ALTER COLUMN pess_codi SET DEFAULT nextval('public.main_code_seq')

But, my table pg_attrdef is returning this default value

SELECT pg_get_expr(adbin, adrelid)
FROM pg_attrdef
WHERE adrelid = 'legacy.sys_pessoa'::regclass;

-- Retorna: nextval('main_code_seq'::regclass)

As you can see, returns without the public schema, but i need this value with full name because my php framework (YiiFramework 1.1) in my legacy system uses this value for the ActiveRecord

In this case, without public, the framework tries to save with the sequence legacy.main_code_seq, that doesn't exists

What can i do? my last solution is to set the value by coding before save but i want a more clean solution.

0 Answers
Related