Re: Getting show results into a table

From: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: "PostgreSQL General (pgsql-general(at)postgresql(dot)org)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Getting show results into a table
Date: 2012-11-28 21:47:11
Message-ID: 8585BA53443004458E0BAA6134C5A7FBB1D2251E@EGEXCMB01.oww.root.lcl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Thanks

-----Original Message-----
From: Guillaume Lelarge [mailto:guillaume(at)lelarge(dot)info]
Sent: Wednesday, November 28, 2012 3:24 PM
To: Little, Douglas
Cc: PostgreSQL General (pgsql-general(at)postgresql(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2012-11-28 21:58:16 Re: 'alternatives'
Previous Message Guillaume Lelarge 2012-11-28 21:23:38 Re: Getting show results into a table