Re: Using Insert - Default in a condition expression ?? - Mailing list pgsql-general

From Sim Zacks
Subject Re: Using Insert - Default in a condition expression ??
Date
Msg-id 4AC1ACC8.6090606@compulab.co.il
Whole thread Raw
In response to Using Insert - Default in a condition expression ??  (Postgres User <postgres.developer@gmail.com>)
Responses Re: Using Insert - Default in a condition expression ??  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List 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

pgsql-general by date:

Previous
From: Postgres User
Date:
Subject: Using Insert - Default in a condition expression ??
Next
From: Postgres User
Date:
Subject: Re: Using Insert - Default in a condition expression ??