Re: Error while restoring database

From: "Johann Zuschlag" <zuschlag(at)online(dot)de>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error while restoring database
Date: 2001-10-21 20:03:52
Message-ID: E15vOmY-0007yg-00@mrelay01.kundenserver.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 21 Oct 2001 14:14:05 -0400, Tom Lane wrote:

>Looks like these are "shell" operator definitions left over from
>commutator or negator forward references that were never satisfied.
>pg_dump did the right thing to not dump them. I'd say that the backend
>should never have accepted a shell operator def with an empty name,
>though, which is what you seem to have at OID 280347.
>
>Do you happen to have the exact command that you gave to create
>operator 280343 (numeric_neq)? I think what this really boils down
>to is insufficient error checking somewhere in CREATE OPERATOR.

Fortunately I still have the scripts. I used pgAdminII. But I think some
time earlier I used psql for the same operator. So shouldn't make any
difference.

I used the two scripts below. I think in that particular order.
(Still wondering, why there is a negator '<>' in the first one :-)

I just tested them again. No error message.
And I've got one with an empty name!
Always wondered why.

(1)
create function numeric_eq(numeric,float8) returns bool as '
select $1 = $2::numeric;
' language 'sql';

create operator = (
leftarg=numeric,
rightarg=float8,
procedure=numeric_eq,
commutator='=',
negator='<>',
restrict=eqsel,
join=eqjoinsel
);

(2)
create function numeric_neq(numeric,float8) returns bool as '
select $1 = $2::numeric;
' language 'sql';

create operator <> (
leftarg=numeric,
rightarg=float8,
procedure=numeric_neq,
commutator='<>',
negator='',
restrict=eqsel,
join=eqjoinsel
);

regards

Johann Zuschlag
zuschlag(at)online(dot)de

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-10-21 20:18:25 Re: Error while restoring database
Previous Message Serguei Mokhov 2001-10-21 18:40:45 Re: namespaces