More outdated examples

Started by Peter Eisentrautabout 23 years ago6 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";
abs
-----
4.5
(1 row)

What really happens is this:

=> select @ text '-4.5' as "abs";
ERROR: Unable to identify a prefix operator '@' for type 'text'
You may need to add parentheses or an explicit cast

Again, delete or new example?

--
Peter Eisentraut peter_e@gmx.net

#2Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#1)
Re: More outdated examples

I can find no suitable replacement for this example. Can anyone else?

---------------------------------------------------------------------------

Peter Eisentraut wrote:

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";
abs
-----
4.5
(1 row)

What really happens is this:

=> select @ text '-4.5' as "abs";
ERROR: Unable to identify a prefix operator '@' for type 'text'
You may need to add parentheses or an explicit cast

Again, delete or new example?

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: More outdated examples

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I can find no suitable replacement for this example. Can anyone else?

Peter Eisentraut wrote:

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";

Both of the examples in this section have been obsoleted by our recent
elimination of a lot of implicit casts. This one would still work if
text-to-float8 were an implicit cast, but it's not anymore. Also,
though the second one still acts as described, the reason given for it
in the text is wrong: the system is not unable to choose among multiple
alternatives. Rather, it finds *no* alternatives, again because the
text-to-various-int-types casts are no longer implicit.

The closest similar cases that I can find for the first example are not
good replacements because they are also slated for destruction :-(.
Basically, I see us moving away from the preferred-type mechanism, and
perhaps eliminating it entirely soon.

I'd just remove the whole of Example 7.3, I think. The mechanisms are
still there, for now, but they are not invoked in any standard cases.

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#3)
Re: More outdated examples

The following applied patch removes the section Tom thought wasn't
needed anymore.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I can find no suitable replacement for this example. Can anyone else?

Peter Eisentraut wrote:

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";

Both of the examples in this section have been obsoleted by our recent
elimination of a lot of implicit casts. This one would still work if
text-to-float8 were an implicit cast, but it's not anymore. Also,
though the second one still acts as described, the reason given for it
in the text is wrong: the system is not unable to choose among multiple
alternatives. Rather, it finds *no* alternatives, again because the
text-to-various-int-types casts are no longer implicit.

The closest similar cases that I can find for the first example are not
good replacements because they are also slated for destruction :-(.
Basically, I see us moving away from the preferred-type mechanism, and
perhaps eliminating it entirely soon.

I'd just remove the whole of Example 7.3, I think. The mechanisms are
still there, for now, but they are not invoked in any standard cases.

regards, tom lane

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+0-51
#5Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#4)
Re: More outdated examples

The specific case that Tom complained about wasn't even in the latest
documentation sources anymore. I think the patch should be reverted.

Bruce Momjian writes:

The following applied patch removes the section Tom thought wasn't
needed anymore.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I can find no suitable replacement for this example. Can anyone else?

Peter Eisentraut wrote:

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";

Both of the examples in this section have been obsoleted by our recent
elimination of a lot of implicit casts. This one would still work if
text-to-float8 were an implicit cast, but it's not anymore. Also,
though the second one still acts as described, the reason given for it
in the text is wrong: the system is not unable to choose among multiple
alternatives. Rather, it finds *no* alternatives, again because the
text-to-various-int-types casts are no longer implicit.

The closest similar cases that I can find for the first example are not
good replacements because they are also slated for destruction :-(.
Basically, I see us moving away from the preferred-type mechanism, and
perhaps eliminating it entirely soon.

I'd just remove the whole of Example 7.3, I think. The mechanisms are
still there, for now, but they are not invoked in any standard cases.

regards, tom lane

--
Peter Eisentraut peter_e@gmx.net

#6Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#5)
Re: More outdated examples

OK, readded. Thanks.

---------------------------------------------------------------------------

Peter Eisentraut wrote:

The specific case that Tom complained about wasn't even in the latest
documentation sources anymore. I think the patch should be reverted.

Bruce Momjian writes:

The following applied patch removes the section Tom thought wasn't
needed anymore.

---------------------------------------------------------------------------

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

I can find no suitable replacement for this example. Can anyone else?

Peter Eisentraut wrote:

This example in User's Guide section 7.2 doesn't work anymore at all:

tgl=> select @ text '-4.5' as "abs";

Both of the examples in this section have been obsoleted by our recent
elimination of a lot of implicit casts. This one would still work if
text-to-float8 were an implicit cast, but it's not anymore. Also,
though the second one still acts as described, the reason given for it
in the text is wrong: the system is not unable to choose among multiple
alternatives. Rather, it finds *no* alternatives, again because the
text-to-various-int-types casts are no longer implicit.

The closest similar cases that I can find for the first example are not
good replacements because they are also slated for destruction :-(.
Basically, I see us moving away from the preferred-type mechanism, and
perhaps eliminating it entirely soon.

I'd just remove the whole of Example 7.3, I think. The mechanisms are
still there, for now, but they are not invoked in any standard cases.

regards, tom lane

--
Peter Eisentraut peter_e@gmx.net

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073