Thread: BUG #14408: Schema not found error when 2 or more indices declared on temporary table

BUG #14408: Schema not found error when 2 or more indices declared on temporary table

From
vcolborn@gmail.com
Date:
VGhlIGZvbGxvd2luZyBidWcgaGFzIGJlZW4gbG9nZ2VkIG9uIHRoZSB3ZWJz
aXRlOgoKQnVnIHJlZmVyZW5jZTogICAgICAxNDQwOApMb2dnZWQgYnk6ICAg
ICAgICAgIFZpY3RvciBDb2xib3JuCkVtYWlsIGFkZHJlc3M6ICAgICAgdmNv
bGJvcm5AZ21haWwuY29tClBvc3RncmVTUUwgdmVyc2lvbjogOS42LjEKT3Bl
cmF0aW5nIHN5c3RlbTogICAoUmVkIEhhdCA0LjQuNy0xNiksIDY0LWJpdApE
ZXNjcmlwdGlvbjogICAgICAgIAoKSSdtIGZpbmRpbmcgdGhhdCB0aGlzIHJh
dGhlciBzaW1wbGUgcG9zdGdyZXNxbCA5LjYuMSBmdW5jdGlvbg0KDQpDUkVB
VEUgT1IgUkVQTEFDRSBGVU5DVElPTiB0cnlpbmdfdG9faW5kZXhfbWUoKQ0K
UkVUVVJOUyBWT0lEICBBUw0KJEJPRFkkDQogICAgQkVHSU4NCiAgICBDUkVB
VEUgVGVtcG9yYXJ5IFRBQkxFIHRlbXBfZGF0YV90b19pbmRleCAoIA0KICAg
ICAgICBpZCBJTlRFR0VSIE5PVCBOVUxMLCAgICANCiAgICAgICAgdGhpc19p
ZCBVVUlEIE5PVCBOVUxMLA0KICAgICAgICB0aGF0X2lkIHNtYWxsaW50IE5P
VCBOVUxMLA0KICAgICAgICBDT05TVFJBSU5UIGlkeF90ZW1wX2RhdGFfdG9f
aW5kZXhfdW5pcXVlDQogICAgICAgICAgICBVTklRVUUgKGlkLHRoaXNfaWQs
dGhhdF9pZCkgICAgIA0KICAgICk7IA0KICAgIENSRUFURSBJTkRFWCBpZHhf
dGVtcF9kYXRhX3RvX2luZGV4X3RoaXN0aGF0IE9OCnRlbXBfZGF0YV90b19p
bmRleCh0aGlzX2lkLHRoYXRfa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=
vcolborn@gmail.com writes:
> I'm finding that this rather simple postgresql 9.6.1 function
> ...
> is resulting in a schema "" does not exist error. The exact error is:

Hm.  The described symptoms sound quite a bit like an uninitialized-memory
problem.  However, I can't reproduce the problem here (using up-to-date
RHEL6), nor does valgrind complain about this example for me.

            regards, tom lane
I'm able to reproduce on 9.5.3 as well.

Could it possibly related to a configuration setting (or some other common
attribute) I can review/alter?

Very much appreciate your time Tom.




On Tue, Nov 1, 2016 at 3:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> vcolborn@gmail.com writes:
> > I'm finding that this rather simple postgresql 9.6.1 function
> > ...
> > is resulting in a schema "" does not exist error. The exact error is:
>
> Hm.  The described symptoms sound quite a bit like an uninitialized-memory
> problem.  However, I can't reproduce the problem here (using up-to-date
> RHEL6), nor does valgrind complain about this example for me.
>
>                         regards, tom lane
>
Victor Colborn <vcolborn@gmail.com> writes:
> I'm able to reproduce on 9.5.3 as well.

Oh, interesting.

> Could it possibly related to a configuration setting (or some other common
> attribute) I can review/alter?

Can't think what ... but what non-default settings are you using?

Is this a custom build of Postgres, or just an RPM (whose?)

            regards, tom lane

Re: BUG #14408: Schema not found error when 2 or more indices declared on temporary table

From
"David G. Johnston"
Date:
On Tue, Nov 1, 2016 at 12:26 PM, <vcolborn@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      14408
> Logged by:          Victor Colborn
> Email address:      vcolborn@gmail.com
> PostgreSQL version: 9.6.1
> Operating system:   (Red Hat 4.4.7-16), 64-bit
> Description:
>
> I'm finding that this rather simple postgresql 9.6.1 function
> =E2=80=8B[...]
>
>
> is resulting in a schema "" does not exist error. The exact error is:
>
> =E2=80=8B[...]
>
>
> and occurs reliably on the second and subsequent executions. Cut/Pasting
> the
> above SQL chunk reproduces the error...for me. Quite interested if that's
> not the case elsewhere. I have the following clues:
>
> =E2=80=8B[...]=E2=80=8B


> It indicates the name of the not found schema to be "" or "0MA{Start of
> Text} " or some similar variant with non-visible character values.
>

=E2=80=8BMy gut reaction here is to type, by hand, the CREATE FUNCTION code=
 into a
newly created text file and send it through psql.  Your comment about
copy/paste and "non-visible characters" leads me to suspect that whatever
source you are copying from has been "poisoned" by a control character=E2=
=80=8B
that you can't see and that is causing a problem.

David J.
Good suggestion David. Tried that to no resolve. I am getting a successful f=
irst execution, but something is improper on subsequent executions.=20

> On Nov 1, 2016, at 5:00 PM, David G. Johnston <david.g.johnston@gmail.com>=
 wrote:
>=20
>> On Tue, Nov 1, 2016 at 12:26 PM, <vcolborn@gmail.com> wrote:
>=20
>> The following bug has been logged on the website:
>>=20
>> Bug reference:      14408
>> Logged by:          Victor Colborn
>> Email address:      vcolborn@gmail.com
>> PostgreSQL version: 9.6.1
>> Operating system:   (Red Hat 4.4.7-16), 64-bit
>> Description:
>>=20
>> I'm finding that this rather simple postgresql 9.6.1 function
>> =E2=80=8B[...]
>>=20
>> is resulting in a schema "" does not exist error. The exact error is:
>>=20
>> =E2=80=8B[...]
>>=20
>> and occurs reliably on the second and subsequent executions. Cut/Pasting t=
he
>> above SQL chunk reproduces the error...for me. Quite interested if that's=

>> not the case elsewhere. I have the following clues:
> =E2=80=8B[...]=E2=80=8B=20
>> It indicates the name of the not found schema to be "" or "0MA{Start of
>> Text} " or some similar variant with non-visible character values.
>=20
> =E2=80=8BMy gut reaction here is to type, by hand, the CREATE FUNCTION cod=
e into a newly created text file and send it through psql.  Your comment abo=
ut copy/paste and "non-visible characters" leads me to suspect that whatever=
 source you are copying from has been "poisoned" by a control character=E2=80=
=8B that you can't see and that is causing a problem.
>=20
> David J.
>=20
>=20
Both were executables downloaded from the PostgreSQL website and while I wou=
ld suspect the configuration is fairly default, I'm not the only hands at wo=
rk. The 9.5.3 install has been there a while. The 9.6.1 install is newer, ju=
st a month or two.=20

I suspect my environment, configuration, or something specific to "my box" s=
ince it isn't trivial to reproduce.=20

> On Nov 1, 2016, at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>=20
> Victor Colborn <vcolborn@gmail.com> writes:
>> I'm able to reproduce on 9.5.3 as well.
>=20
> Oh, interesting.
>=20
>> Could it possibly related to a configuration setting (or some other commo=
n
>> attribute) I can review/alter?
>=20
> Can't think what ... but what non-default settings are you using?
>=20
> Is this a custom build of Postgres, or just an RPM (whose?)
>=20
>            regards, tom lane