Re: Bug in ALTER LANGUAGE ... RENAME TO ...;

Lists: pgsql-bugs
From: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
To: PostgreSQL BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-12 10:53:42
Message-ID: 1108205622.10551.7.camel@sncmobile.2100.gosniias.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

RenameLanguage procedure in src/backend/commands/proclang.c open
and update pg_catalog.pg_shadow table instead pg_catalog.pg_language.

--
Sergey N. Yatskevich <syatskevich(at)2100(dot)gosniias(dot)ru>

Attachment Content-Type Size
postgresql-renamelg-fix.patch text/x-patch 534 bytes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
Cc: PostgreSQL BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-14 05:11:19
Message-ID: 200502140511.j1E5BJo04916@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Oh, good catch. We will fix that. Thanks.

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

Sergey N. Yatskevich wrote:
> RenameLanguage procedure in src/backend/commands/proclang.c open
> and update pg_catalog.pg_shadow table instead pg_catalog.pg_language.
>
> --
> Sergey N. Yatskevich <syatskevich(at)2100(dot)gosniias(dot)ru>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
Cc: PostgreSQL BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-14 06:19:06
Message-ID: 20737.1108361946@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Sergey N. Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru> writes:
> RenameLanguage procedure in src/backend/commands/proclang.c open
> and update pg_catalog.pg_shadow table instead pg_catalog.pg_language.

Wow. Apparently this has been broken since it was written, and
nobody ever tested it. Thanks!

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
Cc: PostgreSQL BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-14 06:52:22
Message-ID: 20952.1108363942@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> "Sergey N. Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru> writes:
>> RenameLanguage procedure in src/backend/commands/proclang.c open
>> and update pg_catalog.pg_shadow table instead pg_catalog.pg_language.

> Wow. Apparently this has been broken since it was written, and
> nobody ever tested it. Thanks!

BTW, is there a security issue here? In my testing all I got was
harmless "tuple concurrently updated" failures --- but it seems like
this bug ought to result in either a core dump or storing a bogus row
into pg_shadow. Neither of which sound appealing.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
Cc: PostgreSQL BUGS <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-14 18:46:29
Message-ID: 200502141846.j1EIkTd03304@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


Patch applied by Tom. Thanks.

---------------------------------------------------------------------------

Sergey N. Yatskevich wrote:
> RenameLanguage procedure in src/backend/commands/proclang.c open
> and update pg_catalog.pg_shadow table instead pg_catalog.pg_language.
>
> --
> Sergey N. Yatskevich <syatskevich(at)2100(dot)gosniias(dot)ru>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sergey N(dot) Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru>
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: Bug in ALTER LANGUAGE ... RENAME TO ...;
Date: 2005-02-14 19:20:28
Message-ID: 360.1108408828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Sergey N. Yatskevich" <syatskevich(at)2100(dot)gosniias(dot)ru> writes:
> , 14/02/2005 01:52 -0500, Tom Lane :
>> BTW, is there a security issue here?

> I think this is not good but not so bad because:
> 1) ALTER LANGUAGE can be used only users with superuser privilegies

Right --- that check is made before we do anything that could go wrong.
So, no security hole, because if you are superuser you already have the
keys to the kingdom anyway ...

> We catch this error only because we try to do formal testing of all
> PostgreSQL features listed in documentation.

Cool. What progress are you making?

regards, tom lane