Обсуждение: Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

Поиск
Список
Период
Сортировка

Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

От
David Gould
Дата:
I'm sure I've had a stroke or something in the middle of the night and just
didn't notice, but I'm able to reproduce the following on three different
hosts on both 9.2.1 and 9.2.2. As far as I know the only difference between
these queries is whitespace since I just up-arrowed them in psql and
deleted a space or <lf>. And as far as I can tell none of these errors are
correct.

Complete transcript, freshly started 9.2.2.

dg@jekyl:~$ psql
psql (9.2.2)
Type "help" for help.

dg=# CREATE TABLE t (
 i INTEGER,
 PRIMARY KEY (i)
);
ERROR:  type "key" does not exist
LINE 3:  PRIMARY KEY (i)                  ^
dg=# CREATE TABLE t (
 i INTEGER,
   PRIMARY KEY (i)
);
ERROR:  syntax error at or near "PRIMARY"
LINE 3:    PRIMARY KEY (i)            ^
dg=# CREATE TABLE t (
 i INTEGER, PRIMARY KEY (i)
);
ERROR:  column "i" named in key does not exist
LINE 2:  i INTEGER, PRIMARY KEY (i)                    ^

Someone please set me straight, and tell me I've had a brain injury because
I am not comfortable with computers just fucking with me which is the other
explanation.

-dg

--
David Gould              510 282 0869         daveg@sonic.net
If simplicity worked, the world would be overrun with insects.



Re: Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

От
Tom Lane
Дата:
David Gould <daveg@sonic.net> writes:
> I'm sure I've had a stroke or something in the middle of the night and just
> didn't notice, but I'm able to reproduce the following on three different
> hosts on both 9.2.1 and 9.2.2. As far as I know the only difference between
> these queries is whitespace since I just up-arrowed them in psql and
> deleted a space or <lf>. And as far as I can tell none of these errors are
> correct.

Those examples work fine for me in HEAD and 9.2 branch tip.  Corrupted
binaries maybe?  Broken copy of bison?  Sure looks like a parser issue.
        regards, tom lane



Re: Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

От
Josh Kupershmidt
Дата:
On Tue, Dec 11, 2012 at 6:01 PM, David Gould <daveg@sonic.net> wrote:
>
> I'm sure I've had a stroke or something in the middle of the night and just
> didn't notice, but I'm able to reproduce the following on three different
> hosts on both 9.2.1 and 9.2.2. As far as I know the only difference between
> these queries is whitespace since I just up-arrowed them in psql and
> deleted a space or <lf>. And as far as I can tell none of these errors are
> correct.
>
> Complete transcript, freshly started 9.2.2.
>
> dg@jekyl:~$ psql
> psql (9.2.2)
> Type "help" for help.
>
> dg=# CREATE TABLE t (
>  i INTEGER,
>  PRIMARY KEY (i)
> );
> ERROR:  type "key" does not exist
> LINE 3:  PRIMARY KEY (i)

Hrm, although I didn't see such characters in your above text, perhaps
you have some odd Unicode characters in your input. For example, the
attached superficially similar input file will generate the same error
message for me. (The odd character in my input is U+2060, 'Word
Joiner', encoded 0xE2 0x81 0xA0.)

Josh

Вложения

Re: Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

От
David Gould
Дата:
On Tue, 11 Dec 2012 18:58:58 -0700
Josh Kupershmidt <schmiddy@gmail.com> wrote:

> On Tue, Dec 11, 2012 at 6:01 PM, David Gould <daveg@sonic.net> wrote:
> >
> > I'm sure I've had a stroke or something in the middle of the night and just
> > didn't notice, but I'm able to reproduce the following on three different
> > hosts on both 9.2.1 and 9.2.2. As far as I know the only difference between
> > these queries is whitespace since I just up-arrowed them in psql and
> > deleted a space or <lf>. And as far as I can tell none of these errors are
> > correct.
> >
> > Complete transcript, freshly started 9.2.2.
> >
> > dg@jekyl:~$ psql
> > psql (9.2.2)
> > Type "help" for help.
> >
> > dg=# CREATE TABLE t (
> >  i INTEGER,
> >  PRIMARY KEY (i)
> > );
> > ERROR:  type "key" does not exist
> > LINE 3:  PRIMARY KEY (i)
> 
> Hrm, although I didn't see such characters in your above text, perhaps
> you have some odd Unicode characters in your input. For example, the
> attached superficially similar input file will generate the same error
> message for me. (The odd character in my input is U+2060, 'Word
> Joiner', encoded 0xE2 0x81 0xA0.)

Thank you. I got the example via cut and paste from email and pasted it
into psql on different hosts. od tells me it ends each line with:
 \n followed by 0xC2 0xA0 and then normal spaces. The C2A0 thing is apparently NO-BREAK SPACE. Invisible, silent,
odorlessbut still deadly. 
 

Which will teach me not to accept text files from the sort of people who
write code in Word I guess.

-dg

-- 
David Gould              510 282 0869         daveg@sonic.net
If simplicity worked, the world would be overrun with insects.



Re: Strange errors from 9.2.1 and 9.2.2 (I hope I'm missing something obvious)

От
Dan Scott
Дата:
<p dir="ltr"><br /> On Dec 11, 2012 9:28 PM, "David Gould" <<a href="mailto:daveg@sonic.net">daveg@sonic.net</a>>
wrote:<br/> ><br /> > Thank you. I got the example via cut and paste from email and pasted it<br /> > into
psqlon different hosts. od tells me it ends each line with:<br /> ><br /> >   \n followed by 0xC2 0xA0 and then
normalspaces. The C2A0 thing is<br /> >   apparently NO-BREAK SPACE. Invisible, silent, odorless but still
deadly.<br/> ><br /> > Which will teach me not to accept text files from the sort of people who<br /> > write
codein Word I guess.<p dir="ltr">It's not just Word... I was bitten by this last week by a WYSIWYG HTML widget I was
usingto write some documentation. When I copied the examples I had created out of said environment during a final
technicalaccuracy pass and they failed to run in psql, I panicked for a few minutes.<p dir="ltr">I eventually
determinedthat, rather than just wrapping my code in <pre> tags, the widget had created &nbsp; entities that
werefaithfully converted into Unicode non-breaking spaces in the psql input.