Getting show results into a table

Started by Little, Douglasover 13 years ago4 messagesgeneral
Jump to latest
#1Little, Douglas
DOUGLAS.LITTLE@orbitz.com

Is there a way in sql to get the results of the show all command into a table?

I'm expecting something like
Insert into Config_history as select * from (show all);

Doug Little

Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz Worldwide
500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741
Douglas.Little@orbitz.com<mailto:Douglas.Little@orbitz.com>
[cid:image001.jpg@01CDCD65.492B5520] orbitz.com<http://www.orbitz.com/&gt; | ebookers.com<http://www.ebookers.com/&gt; | hotelclub.com<http://www.hotelclub.com/&gt; | cheaptickets.com<http://www.cheaptickets.com/&gt; | ratestogo.com<http://www.ratestogo.com/&gt; | asiahotels.com<http://www.asiahotels.com/&gt;

Attachments:

image001.jpgimage/jpeg; name=image001.jpgDownload
#2Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Little, Douglas (#1)
Re: Getting show results into a table

Little, Douglas wrote:

Is there a way in sql to get the results of the show all command into a table?

I'm expecting something like
Insert into Config_history as select * from (show all);

insert into Config_history
 select name, setting, short_desc from pg_settings;

or maybe:

create table config_history as
 select name, setting, short_desc as description from pg_settings;

-Kevin

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Guillaume Lelarge
guillaume@lelarge.info
In reply to: Little, Douglas (#1)
Re: Getting show results into a table

On Wed, 2012-11-28 at 12:38 -0600, Little, Douglas wrote:

Is there a way in sql to get the results of the show all command into a table?

SELECT name, setting, short_desc FROM pg_settings

I'm expecting something like
Insert into Config_history as select * from (show all);

INSERT INTO config_history
SELECT name, setting, short_desc FROM pg_settings;

That should work.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Little, Douglas
DOUGLAS.LITTLE@orbitz.com
In reply to: Guillaume Lelarge (#3)
Re: Getting show results into a table

Thanks everybody. Always wondered where the command was sourcing the data.

Thanks

-----Original Message-----
From: Guillaume Lelarge [mailto:guillaume@lelarge.info]
Sent: Wednesday, November 28, 2012 3:24 PM
To: Little, Douglas
Cc: PostgreSQL General (pgsql-general@postgresql.org)
Subject: Re: [GENERAL] Getting show results into a table

On Wed, 2012-11-28 at 12:38 -0600, Little, Douglas wrote:

Is there a way in sql to get the results of the show all command into a table?

SELECT name, setting, short_desc FROM pg_settings

I'm expecting something like
Insert into Config_history as select * from (show all);

INSERT INTO config_history
SELECT name, setting, short_desc FROM pg_settings;

That should work.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general