[PATCH] Make LNT compatible with PostgreSQL

Chris Matthews chris.matthews at apple.com
Mon Jul 21 15:49:51 PDT 2014

Okay. That is fine.  I think it is okay to tell people to start fresh if they are going to switch.

Go ahead and commit your patch to add the Postgres creation capability.

Can you add a little blurb to docs/tools.rst explaining how to create for Postgres.  Could you also add a Postgres requires directive to the LNT test suite (off by default), and make a new test in lnttool to test this code path? 

> On Jul 21, 2014, at 1:34 PM, Yi Kong <kongy.dev at gmail.com> wrote:
> I tried to migrate using SQLite's dump and import, but that didn't
> work mainly because BLOBs are not supported in Postgres, and date
> object has different format. pgloader does the job, but is really
> difficult to set up and sometimes produces malformed output(maybe
> because my distribution ships a very old version of it). I found
> SQLAlchemy provides session.merge() that supposed to do the job, but I
> haven't tried it yet.
> Besides, I don't believe we really need to provide documentation for
> migration, as it's a complicated and risky process, especially that
> people hack LNT extensively. We should suggest users to create a new
> database or otherwise migrate by their own effort.
> -Yi
> On 21 July 2014 17:15, Chris Matthews <chris.matthews at apple.com> wrote:
>> I have never tried a migration, I have always started fresh from an empty database.
>> Can you be specific about the problems you encountered? Were you trying to migrate at the Sqlalchemy level? Or using sqlite’s dump command, and postgres’ import?  As far as I know, Postgres supports a superset of sqlite’s?
>>> On Jul 20, 2014, at 2:34 PM, Yi Kong <kongy.dev at gmail.com> wrote:
>>> Hi Chris, Daniel,
>>> After toying with the SQLite for a while, I found the existing
>>> migration tools are too complicated to use and error prone, since some
>>> db features we are using in SQLite are not supported in Postgres. I
>>> suggest we add psql support now so that people can start using it if
>>> starting anew or willing to migrate manually, and I will extend LNT to
>>> support db migration(or merging) when I have time.
>>> I'm not an expert in databases, any ideas would be appreciated.
>>> Cheers,
>>> -Yi
>>> On 2 July 2014 21:09, Yi Kong <kongy.dev at gmail.com> wrote:
>>>> On 2 July 2014 18:59, Chris Matthews <chris.matthews at apple.com> wrote:
>>>>> I think if we are going to expose support for Postgres to users, which I
>>>>> agree we should, we need a new section in the documentation explaining how
>>>>> to do it, and at least a smoke test in test suite to make sure we don’t
>>>>> break support, and a test to make sure the create call works with a postgres
>>>>> URLs.
>>>>> Yi, can you add those things to your patch, or in subsequent patches?
>>>>> It would also be important to have a section of docs on how to migrate from
>>>>> sqlite to Postgres, as I assume that is the path most users would end up
>>>>> taking.
>>>> Sure.
>>>>> We do also have to be careful.  There are situations I have found were the
>>>>> same flask queries don’t return the same results on sqlite and Postgres.  I
>>>>> have not hit this in LNT, but in development of LNT extensions, so it is
>>>>> something to watch out for!

More information about the llvm-commits mailing list