Getting show results into a table
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/> | ebookers.com<http://www.ebookers.com/> | hotelclub.com<http://www.hotelclub.com/> | cheaptickets.com<http://www.cheaptickets.com/> | ratestogo.com<http://www.ratestogo.com/> | asiahotels.com<http://www.asiahotels.com/>
Attachments:
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
Import Notes
Resolved by subject fallback
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
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