SHOW ALL as a query result

Started by Christopher Kings-Lynnealmost 24 years ago5 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

Hi All,

Now that Tom's modified the EXPLAIN output to appear as a query result,
maybe SHOW and SHOW ALL should also be modified in that way. The current
NOTICE: business is a bit messy, and it sure would assist projects just as
pgAccess, phpPgAdmin and pgAdmin with displaying configuration!

Also, what else could be usefully modified?

Chris

ps.

Show quoted text

BTW, see: ~/pgsql/src/backend/commands/explain.c
for the new functions Tom Lane wrote which send explain results to the
front end as if they were from a select statement. Very informative.
Specifically see:
begin_text_output(CommandDest dest, char *title);
do_text_output(TextOutputState *tstate, char *aline);
do_text_output_multiline(TextOutputState *tstate, char *text);
end_text_output(TextOutputState *tstate);

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Christopher Kings-Lynne (#1)
Re: SHOW ALL as a query result

Christopher Kings-Lynne writes:

Now that Tom's modified the EXPLAIN output to appear as a query result,
maybe SHOW and SHOW ALL should also be modified in that way. The current
NOTICE: business is a bit messy, and it sure would assist projects just as
pgAccess, phpPgAdmin and pgAdmin with displaying configuration!

Yes, I was going to suggest this myself. It would be very useful to have
this information available to the JDBC driver so you could query, say, the
default transaction isolation.

--
Peter Eisentraut peter_e@gmx.net

#3Joe Conway
mail@joeconway.com
In reply to: Christopher Kings-Lynne (#1)
Re: SHOW ALL as a query result

Christopher Kings-Lynne wrote:

Hi All,

Now that Tom's modified the EXPLAIN output to appear as a query
result, maybe SHOW and SHOW ALL should also be modified in that way.
The current NOTICE: business is a bit messy, and it sure would
assist projects just as pgAccess, phpPgAdmin and pgAdmin with
displaying configuration!

Also, what else could be usefully modified?

Chris

ps.

BTW, see: ~/pgsql/src/backend/commands/explain.c for the new
functions Tom Lane wrote which send explain results to the front
end as if they were from a select statement. Very informative.
Specifically see: begin_text_output(CommandDest dest, char
*title); do_text_output(TextOutputState *tstate, char *aline);
do_text_output_multiline(TextOutputState *tstate, char *text);
end_text_output(TextOutputState *tstate);

I was also thinking about this, but the EXPLAIN approach is only useful
if you never want to select on the output. Another approach might be to
write a function, say show_all(), and then modify gram.y to make:

SHOW ALL;
- equivalent to -
SELECT show_all();

so that you could do:

SELECT show_var() FROM (SELECT show_all()) as s WHERE show_var_name()
LIKE 'wal%';

or something like that.

Joe

#4Dave Page
dpage@vale-housing.co.uk
In reply to: Joe Conway (#3)
Re: SHOW ALL as a query result

-----Original Message-----
From: Christopher Kings-Lynne [mailto:chriskl@familyhealth.com.au]
Sent: 03 April 2002 02:50
To: Hackers
Cc: Tom Lane; peter_e@gmx.net
Subject: SHOW ALL as a query result

Hi All,

Now that Tom's modified the EXPLAIN output to appear as a
query result, maybe SHOW and SHOW ALL should also be modified
in that way. The current
NOTICE: business is a bit messy, and it sure would assist
projects just as pgAccess, phpPgAdmin and pgAdmin with
displaying configuration!

It certainly would. Of course we've worked around it now though :-(, but
future enhancements....

Regards, Dave.

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: SHOW ALL as a query result

Christopher Kings-Lynne wrote:

Hi All,

Now that Tom's modified the EXPLAIN output to appear as a query result,
maybe SHOW and SHOW ALL should also be modified in that way. The current
NOTICE: business is a bit messy, and it sure would assist projects just as
pgAccess, phpPgAdmin and pgAdmin with displaying configuration!

Also, what else could be usefully modified?

Added to TODO:

o Allow SHOW to output as a query result, like EXPLAIN

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026