Re: pg_dump and boolean format - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: pg_dump and boolean format
Date
Msg-id 2C736715-3E1C-4599-9C25-42B475D7B145@seespotcode.net
Whole thread Raw
In response to Re: pg_dump and boolean format  (Scott Frankel <frankel@circlesfx.com>)
Responses Re: pg_dump and boolean format
List pgsql-general
On Aug 11, 2010, at 18:21 , Scott Frankel wrote:

>
> On Aug 11, 2010, at 10:12 AM, Michael Glaesemann wrote:
>
>> One option is to use COPY to export the data in a format you like. For example: COPY (SELECT CAST(boolean_column AS
INT)FROM my_table) TO STDOUT. Then write a script which reads the exported data files and loads them into your sqlite
database.COPY WITH CSV would likely be helpful as well. 
>
> With the number of tables and insert statements I'll be wrangling, I was hopeful I could coerce pg_dump to perform
the"AS INT" cast. 

Query the database Information Schema or system tables to provide a list of the table names. By using COPY WITH CSV
HEADERand the names of the tables, you should be able to generate INSERT statements programatically. 

Michael Glaesemann
grzm seespotcode net




pgsql-general by date:

Previous
From: Scott Frankel
Date:
Subject: Re: pg_dump and boolean format
Next
From: "Joshua D. Drake"
Date:
Subject: Re: PG-friendly CASE/modeling tool?