Re: Like vs '=' bug with indexing

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: m w <mttf2000(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Like vs '=' bug with indexing
Date: 2001-02-04 21:49:55
Message-ID: 3A7DCE83.4E2926AD@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> Hannu Krosing <hannu(at)tm(dot)ee> writes:
> > Is there no simple (i.e. cheap) way to disallow \0 alltogether for
> > these types then ?
> > perhaps just strip them out in textin() (or is it text_in()) ?
>
> They *are* stripped out in textin(), by virtue of the fact that
> textin expects to see a null-terminated input string.

Ok, I was mistaken to think that pg_trigger.tgargs contained real \0's
and not fakes and I was able to get similar output from other char
types by using \\000 - You never can tell how many \\\\ are required to
input a single \ to next level.

Also I remember being told that bytea _can_ hold embedded \0, no ?

> > Should we not examine "the _possible_ outputs of every C-coded function
> > to make sure it produces a valid value of the datatype" ;)
>
> Go for it.
>
> Possibly chr() should reject chr(0) ...

there is no function chr() at least in 7.0.2.

and char is not usable from psql (gives out strange errors);

hannu=# select char(0);
ERROR: length for type 'bpchar' must be at least 1
hannu=# select char(32);
ERROR: parser: parse error at or near ";"
hannu=# select char('a');
ERROR: parser: parse error at or near "'"

could it be possible somehow distinguish between user callable (safe)
functions and "internal" ones ?

------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-02-04 21:57:23 Re: syslog logging setup broken?
Previous Message Tom Lane 2001-02-04 20:15:34 Re: syslog logging setup broken?