Re: pg_dump and boolean format

From: Scott Frankel <frankel(at)circlesfx(dot)com>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump and boolean format
Date: 2010-08-12 01:09:09
Message-ID: 87F6C181-EB5E-4A0C-9852-E1687CA73D16@circlesfx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Aug 11, 2010, at 3:57 PM, Michael Glaesemann wrote:

>
> 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 HEADER and the names
> of the tables, you should be able to generate INSERT statements
> programatically.

Good point. Thanks for the suggestions!
Scott

> Michael Glaesemann
> grzm seespotcode net
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marco Colombo 2010-08-12 01:24:18 Re: MySQL versus Postgres
Previous Message Satoshi Nagayasu 2010-08-12 00:51:18 Re: ECPG - Some errno definitions don't match to the manual