Re: How to insert either a value or the column default?

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: How to insert either a value or the column default?
Дата
Msg-id CA+mi_8YgxKzJVAzVtq2HrrNVcRh_2RMS7nxi4mJqV6Cf90ZB-Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to insert either a value or the column default?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Mon, Aug 25, 2014 at 3:26 PM, Adrian Klaver
<adrian.klaver@aklaver.com> wrote:
> On 08/25/2014 06:32 AM, W. Matthew Wilson wrote:

>> First of all, thanks for showing this trick!
>>
>> But I am confused.  Will this trick stop working in a future version
>> of psycopg2?  Should I avoid using it?
>
>
> Here is the email laying out the issues:
>
> http://www.postgresql.org/message-id/AANLkTi=ym3SCQKCQBtp8RJHUswwAPOpjXYKTXS=aHWzp@mail.gmail.com

That's correct, thank you Adrian.

Matthew: no, this will correctly work in all the future psycopg2
versions. Even if we started supporting a new protocol, such as the
ISQLParam referred in the mentioned email, it won't be the default in
psycopg2 and it should be enabled on purpose.

The new protocol should be the default in this mythical psycopg3
instead. If something can be imported as psycopg2 it will support the
ISQLQuote protocol by default, hence the Default object as implemented
in this thread will work.

-- Daniele


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: How to insert either a value or the column default?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Query planner question