[Go-essp-tech] Idempotent SQL?

Gavin M. Bell gavin at llnl.gov
Fri Feb 4 10:53:28 MST 2011


 Hi,

:-(
I tried that... it doesn't work for postgres :-|.
I am trying to find the analogous command for postgres.

(maybe we should just use H2...) ;-).
 

On 2/4/11 9:50 AM, Cinquini, Luca (3880) wrote:
> Hi Gavin,
> this kind of statements worked for Java H2DB - not sure about postgres...
>
> -- WORKFLOW INSTANCE TYPE
> CREATE TABLE IF NOT EXISTS WORKFLOW_INSTANCE_TYPE (
> TYPE INT PRIMARY KEY NOT NULL,
> DESCRIPTION VARCHAR(200) NOT NULL
> );
> MERGE INTO WORKFLOW_INSTANCE_TYPE (TYPE, DESCRIPTION ) VALUES (1,
> 'DESDynI Standard');
>
> Luca
>
> On Feb 4, 2011, at 10:45 AM, Gavin M. Bell wrote:
>
>> Hey SQL Mavens...
>>
>> Does anyone know how to create idempotent SQL scripts?
>> If something is there already, then don't create it...
>> If it is not, then do so.
>> (the pithier the better)
>>
>> Thanks
>> -- 
>> Gavin M. Bell
>> Lawrence Livermore National Labs
>> --
>>
>>  "Never mistake a clear view for a short distance."
>>        	       -Paul Saffo
>>
>> (GPG Key - http://rainbow.llnl.gov/dist/keys/gavin.asc)
>>
>>  A796 CE39 9C31 68A4 52A7  1F6B 66B7 B250 21D5 6D3E
>> _______________________________________________
>> GO-ESSP-TECH mailing list
>> GO-ESSP-TECH at ucar.edu <mailto:GO-ESSP-TECH at ucar.edu>
>> http://mailman.ucar.edu/mailman/listinfo/go-essp-tech
>

-- 
Gavin M. Bell
Lawrence Livermore National Labs
--

 "Never mistake a clear view for a short distance."
       	       -Paul Saffo

(GPG Key - http://rainbow.llnl.gov/dist/keys/gavin.asc)

 A796 CE39 9C31 68A4 52A7  1F6B 66B7 B250 21D5 6D3E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/go-essp-tech/attachments/20110204/f1a47ee1/attachment.html 


More information about the GO-ESSP-TECH mailing list