Search Postgresql Archives

Re: Restore 1 Table from pg_dumpall?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 23 January 2013 04:57, Rich Shepard <rshepard@xxxxxxxxxxxxxxx> wrote:
>   Is there a way I can extract a single table's schema and data from the
> full backup? If so, I can then drop the fubar'd table and do it correctly
> this time.

You should grep for:
- CREATE TABLE
- COPY

statements and then note line numbers (fgrep -n). Finally, used `sed`
to get the right part(s) of a file (schema + data):
sed -n 'startline,endlinep' dump.sql > out.sql  (ie. sed -n '10,1000p')

--
Ondrej


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux