From: | Sim Zacks <sim(at)compulab(dot)co(dot)il> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: schema rename sequence issue |
Date: | 2006-01-30 14:51:21 |
Message-ID: | drl97q$jve$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
It seems to be an in-memory issue or something like that.
5 hours later it gave me another error implying that it was reading the
pg_attrdef table.
Apparantly the first number in the byte string is the number of
characters in the string, and since my new schema is 1 character shorter
then the old one, it is croaking.
So I changed it in one case to see if it would make a difference and I
got the exact same error. Which implies, that this table is read into
memory and reread at intervals. So now I'll wait till tomorrow to see if
the fix I did works and then I'll be able to determine if that fix is it
or not.
Sim Zacks wrote:
> Thank you for your thoughts, but I am hoping that I don't have to
> update 400 tables manually.
>
> The way I understand the postgresql structure is that each field is
> listed in the pg_attribute table and those fields with default values
> have records in the pg_attrdef table. I changed both the text and the
> binary to reflect the new schema and using PGAdmin3, everything
> "looks" correct. So when I click on the table it tells me the sequence
> is in the correct schema.
>
> Unfortunately, Insert doesn't work.
>
> Thank You
> Sim
> ________________________________________________________________________________
>
>
> On Jan 30, 2006, at 19:03 , Sim Zacks wrote:
>
>> I thought the pg_attrdef table was the defaults.
>> Is there another table that contains the defaults
>
> What I'm thinking of is this situation:
>
> create table foo
> (
> foo_id serial primary key
> , foo_value text not null unique
> );
>
> This will create a sequence (public.foo_id_key_seq, I think) as well
> as a table
> public.foo
> (
> foo_id integer primary key default nextval('public.foo_id_key_seq')
> , foo_value text not null unique
> );
>
> (And some indexes as well, but we'll set those aside for now.)
>
> You've renamed the schema, but I think you need to update the default
> for the foo_id column manually, e.g.,
>
> alter table stock.foo alter column foo_id set default = nextval
> ('stock.foo_id_key_seq');
>
> Syntax not checked.
>
> If this isn't what it is, perhaps someone else has an idea.
>
> Michael Glaesemann
> grzm myrealbox com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-01-30 14:57:37 | Re: postgresql performace degrading after a while |
Previous Message | Jan Wieck | 2006-01-30 14:40:44 | Re: stats for failed transactions (was Re: [GENERAL] VACUUM |