Re: Using Insert - Default in a condition expression ??

Поиск
Список
Период
Сортировка
От Postgres User
Тема Re: Using Insert - Default in a condition expression ??
Дата
Msg-id b88c3460909282353y65264361o78b1cd160b4035d3@mail.gmail.com
обсуждение исходный текст
Ответ на Using Insert - Default in a condition expression ??  (Postgres User <postgres.developer@gmail.com>)
Ответы Re: Using Insert - Default in a condition expression ??  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
>> I'm trying to write an INSERT INTO statement that will use a DEFAULT
>> value when an input parameter is null.
>>
> Neither of my 2 methods are pretty.
> 1) Use a trigger.
> 2) Grab and cast the default value from the information_schema.columns
> view and plug it in.
>
> Another option is to build your insert sql as a string and then execute it.
>
> Sim
>

Thanks... those approaches came to mind.  But I need something more
flexible as the Insert functions are generated by an ORM layer.  It
has to be simpler.

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

Предыдущее
От: Sim Zacks
Дата:
Сообщение: Re: Using Insert - Default in a condition expression ??
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Using Insert - Default in a condition expression ??