two buglets: createlang and pg_get_triggerdef
two buglets: createlang and pg_get_triggerdef
От:
Alvaro Herrera Munoz <alvherre@dcc.uchile.cl>
Дата:
Hackers, Two buglets: The first one is in createlang, trying to create a language without enough permission: $ createlang -d alvherre plpgsql createlang: language installation failed: ERROR: c: permission denied What's the "c" it's complaning about? The second one is in pg_get_triggerdef(): alvherre=> create table test (foo int); CREATE TABLE alvherre=> create function foofun() returns trigger as 'select 1' language plpgsql; CREATE FUNCTION alvherre=> create trigger my_little_trigger before update on test execute procedure foofun(); CREATE TRIGGER alvherre=> \d test Table "public.test"Column | Type | Modifiers --------+---------+-----------foo | integer | Triggers: my_little^trigger BEFORE UPDATE ON test FOR EACH STATEMENT EXECUTE PROCEDURE foofun() Note that the 9th character has been changed to "^". I've seen the 9th character change in all triggers here. If I look at pg_trigger the name is fine: alvherre=> select tgname from pg_trigger where tgname='my_little_trigger'; tgname -------------------my_little_trigger (1 row) This is not on latest CVS, but I haven't seem them reported nor fixed. -- Alvaro Herrera () "El sentido de las cosas no viene de las cosas, sino de las inteligencias que las aplican a sus problemas diarios en busca del progreso." (Ernesto Hern�ndez-Novich)
Re: two buglets: createlang and pg_get_triggerdef
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Alvaro Herrera Munoz writes: > $ createlang -d alvherre plpgsql > createlang: language installation failed: ERROR: c: permission denied > What's the "c" it's complaning about? The C procedural language, presumably. This message is not up to our new message standards I suppose ... it ought to mention what kind of object "c" is. > The second one is in pg_get_triggerdef(): > Triggers: > my_little^trigger BEFORE UPDATE ON test FOR EACH STATEMENT EXECUTE PROCEDURE foofun() Bizarre. It looks fine here. What platform are you on? Anyone else see this? > This is not on latest CVS, but I haven't seem them reported nor fixed. Please pull latest CVS and do a full rebuild (make distclean etc). If you still see it after that, I'll pursue further. regards, tom lane
Re: two buglets: createlang and pg_get_triggerdef
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
I said: > Alvaro Herrera Munoz writes: >> $ createlang -d alvherre plpgsql >> createlang: language installation failed: ERROR: c: permission denied >> What's the "c" it's complaning about? > The C procedural language, presumably. This message is not up to our new > message standards I suppose ... it ought to mention what kind of object > "c" is. Okay, now it says $ createlang plpgsql test createlang: language installation failed: ERROR: permission denied for language c $ Let me know about the pg_get_triggerdef() thing ... regards, tom lane
Re: two buglets: createlang and pg_get_triggerdef
От:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Дата:
> > Triggers:
> > my_little^trigger BEFORE UPDATE ON test FOR EACH STATEMENT EXECUTE
PROCEDURE foofun()
>
> Bizarre. It looks fine here. What platform are you on? Anyone else
> see this?
I actually had this while I was developing the feature. I had thought I had
fixed it. It's basically total weirdness in the behaviour of
appendStringInfo function IIRC. Basically, I _think_ it was caused by
having two %s's in this:
appendStringInfo(&buf, "CREATE %sTRIGGER %s ", trigrec->tgisconstraint ?
"CONSTRAINT " : "", quote_identifier(tgname));
I managed to get rid of the bug on my development machine, but it's
obviously cropped up again :(
Chris
Re: two buglets: createlang and pg_get_triggerdef
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Christopher Kings-Lynne" writes: >> Bizarre. It looks fine here. What platform are you on? Anyone else >> see this? > I actually had this while I was developing the feature. And what platform are *you* on? It seems a really hard-to-believe bug... regards, tom lane
Re: two buglets: createlang and pg_get_triggerdef
От:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Дата:
> > I actually had this while I was developing the feature. > > And what platform are *you* on? It seems a really hard-to-believe > bug... FreeBSD/i386 I developed it on. Chris
Re: two buglets: createlang and pg_get_triggerdef
От:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Дата:
> > I actually had this while I was developing the feature. > > And what platform are *you* on? It seems a really hard-to-believe > bug... This will actually be a must-fix for 7.4, as pg_dump uses it now to dump triggers... Chris
Re: two buglets: createlang and pg_get_triggerdef
От:
Alvaro Herrera <alvherre@dcc.uchile.cl>
Дата:
On Thu, Jul 31, 2003 at 05:06:12PM -0400, Tom Lane wrote: > Alvaro Herrera Munoz writes: > > $ createlang -d alvherre plpgsql > > createlang: language installation failed: ERROR: c: permission denied > > What's the "c" it's complaning about? > > The C procedural language, presumably. This message is not up to our new > message standards I suppose ... it ought to mention what kind of object > "c" is. Well, it's kind of unobvious anyway since I'm trying to create plpgsql, why should I care for C? Maybe createlang could detect the condition and report a different error to the user. > > The second one is in pg_get_triggerdef(): > > > Triggers: > > my_little^trigger BEFORE UPDATE ON test FOR EACH STATEMENT EXECUTE PROCEDURE foofun() > > Please pull latest CVS and do a full rebuild (make distclean etc). If > you still see it after that, I'll pursue further. Nope, I don't see it now. -- Alvaro Herrera () Y dijo Dios: "Que sea Satanás, para que la gente no me culpe de todo a mí." "Y que hayan abogados, para que la gente no culpe de todo a Satanás"