SHOW command always returns text field

Started by Peter Eisentrautover 14 years ago4 messages
#1Peter Eisentraut
peter_e@gmx.net

I was slightly surprised the other day that the SHOW command always
returns a field of type text even if the underlying parameter has one of
the other types (int, real, etc.). Is this intentional? Would it be
worth refining?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: SHOW command always returns text field

Peter Eisentraut <peter_e@gmx.net> writes:

I was slightly surprised the other day that the SHOW command always
returns a field of type text even if the underlying parameter has one of
the other types (int, real, etc.). Is this intentional? Would it be
worth refining?

I'm disinclined to mess with it. One thing that couldn't easily be
"cleaned up" is the textual output for nominally-numeric parameters
that have units.

regards, tom lane

#3Alvaro Herrera
alvherre@commandprompt.com
In reply to: Tom Lane (#2)
Re: SHOW command always returns text field

Excerpts from Tom Lane's message of mié ago 10 14:12:49 -0400 2011:

Peter Eisentraut <peter_e@gmx.net> writes:

I was slightly surprised the other day that the SHOW command always
returns a field of type text even if the underlying parameter has one of
the other types (int, real, etc.). Is this intentional? Would it be
worth refining?

I'm disinclined to mess with it. One thing that couldn't easily be
"cleaned up" is the textual output for nominally-numeric parameters
that have units.

How about having it return a record? We could have the units in a
separate column ... and perhaps show the raw value too (I have wished to
see the raw value plenty of times). Backwards compatibility is a
serious problem though :-)

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: SHOW command always returns text field

Alvaro Herrera <alvherre@commandprompt.com> writes:

Excerpts from Tom Lane's message of mié ago 10 14:12:49 -0400 2011:

Peter Eisentraut <peter_e@gmx.net> writes:

I was slightly surprised the other day that the SHOW command always
returns a field of type text even if the underlying parameter has one of
the other types (int, real, etc.). Is this intentional? Would it be
worth refining?

I'm disinclined to mess with it. One thing that couldn't easily be
"cleaned up" is the textual output for nominally-numeric parameters
that have units.

How about having it return a record?

I think that's already covered by the pg_settings view. The question is
whether plain SHOW ought to change. I don't see the point.

regards, tom lane