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

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: Postgres User <postgres(dot)developer(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Using Insert - Default in a condition expression ??
Date: 2009-09-29 06:44:24
Message-ID: 4AC1ACC8.6090606@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Postgres User 2009-09-29 06:53:37 Re: Using Insert - Default in a condition expression ??
Previous Message Postgres User 2009-09-29 06:25:23 Using Insert - Default in a condition expression ??