Re: Extension Packaging

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: Extension Packaging
Дата
Msg-id D34C90FC-F5AF-43CD-AACA-C943EE56E2DF@kineticode.com
обсуждение исходный текст
Ответ на Re: Extension Packaging  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список pgsql-hackers
On Apr 20, 2011, at 8:04 PM, Daniele Varrazzo wrote:

> Specifically, I parse the version from the control file using:
>
>    PGMP_VERSION=$(shell grep default_version pgmp.control | sed -e
> "s/default_version = '\(.*\)'/\1/")

Oh, that's not bad. Thanks.

> so the Makefile doesn't have to be maintained for it. To tell apart <
> 9.1 and >= 9.1 I've used instead:
>
>    PG91 = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" &&
> echo pre91 || echo 91)
>    ifeq ($(PG91),91)
>    ...
>    else
>    ...

Oh, definitely better and more future-proof than what I had. Mind if I poach these examples and document them for PGXN
distribution?

> For my extension I'm less concerned by having the install sql named in
> different ways or by the upgrade sql as all these files are generated
> by scripts. You may find useful this one
> <https://github.com/dvarrazzo/pgmp/blob/master/tools/sql2extension.py>
> to generate the upgrade sql from the install sql. For my extension I
> require Python and have all the sql files generated by the Makefile at
> install time; if you don't want this dependency you ma

Yeah, I recently started using Perl to break up pgTAP into multiple files. I struggled for a while over whether or not
torequire it or to build the files at distribution time. I finally settled for having it run at install time, but it's
notrequired: you just wouldn't get the broken-up files without it, only the great big one. I guess one could do the
samewith your script: If you don't have python, you don't get the unpackaged migration scripts. 

Thanks again,

David




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Extension Packaging
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump --binary-upgrade vs. ALTER TYPE ... DROP ATTRIBUTE