Re: [GENERAL] if exists...does it exists for insert statments?

2007-12-11 Thread Richard Broersma Jr
--- On Tue, 12/11/07, Pau Marc Munoz Torres <[EMAIL PROTECTED]> wrote: > Thanks, i'll test it tomorrow OOPS, I just noticed a mistake. INSERT INTO SP SELECT a, b FROM ( VALUES ( 'cesp', 'sp' )) AS tmp( a, b ) LEFT JOIN Sp ON (Sp.col1,Sp.col2)=(tmp.a,tmp.b) WHERE (Sp.

Re: [GENERAL] if exists...does it exists for insert statments?

2007-12-11 Thread Pau Marc Munoz Torres
Thanks, i'll test it tomorrow pau 2007/12/11, Richard Broersma Jr <[EMAIL PROTECTED]>: > > --- On Tue, 12/11/07, Pau Marc Munoz Torres <[EMAIL PROTECTED]> wrote: > > could i use a sentence similar to the mysql sentence > > > > insert if not exist into SP values > > ('cesp','sp'); > > > > in postg

Re: [GENERAL] if exists...does it exists for insert statments?

2007-12-11 Thread Richard Broersma Jr
--- On Tue, 12/11/07, Pau Marc Munoz Torres <[EMAIL PROTECTED]> wrote: > could i use a sentence similar to the mysql sentence > > insert if not exist into SP values > ('cesp','sp'); > > in postgresql? Using standard ANSI-SQL the statement could be re-written: INSERT INTO SP SELECT a, b

Re: [GENERAL] if exists...does it exists for insert statments?

2007-12-11 Thread Pavel Stehule
Hello On 11/12/2007, Pau Marc Munoz Torres <[EMAIL PROTECTED]> wrote: > could i use a sentence similar to the mysql sentence > > insert if not exist into SP values ('cesp','sp'); > insert into sp select 'cesp','sp' except select * from SP; Regards Pavel Stehule > in postgresql? > > pau >

[GENERAL] if exists...does it exists for insert statments?

2007-12-11 Thread Pau Marc Munoz Torres
could i use a sentence similar to the mysql sentence insert if not exist into SP values ('cesp','sp'); in postgresql? pau -- Pau Marc Muñoz Torres Laboratori de Biologia Computacional Institut de Biotecnologia i Biomedicina Vicent Villar Universitat Autonoma de Barcelona E-08193 Bellaterr

Re: [GENERAL] IF EXISTS

2006-09-25 Thread Dawid Kuroczko
On 9/21/06, stevethames <[EMAIL PROTECTED]> wrote: Ok, thanks, Jeff. This is not a critical problem. Just annoying. I'll wait for 8.2. BTW, while I can see the reason for adding the IF EXISTS clause to the language for checking the existence of objects, wouldn't it be easier to simply provide

Re: [GENERAL] IF EXISTS

2006-09-24 Thread stevethames
Ok, thanks, Jeff. This is not a critical problem. Just annoying. I'll wait for 8.2. BTW, while I can see the reason for adding the IF EXISTS clause to the language for checking the existence of objects, wouldn't it be easier to simply provide the PL/PgSQL language for script loading? Then it wo

Re: [GENERAL] IF EXISTS

2006-09-20 Thread Karsten Hilbert
On Wed, Sep 20, 2006 at 04:12:16PM -0700, Jeff Davis wrote: > In 8.2, which is currently still in production, they have added the > feature where you can do things like: > > DROP SEQUENCE IF EXISTS mysequence; > CREATE SEQUENCE mysequence; > > Which makes writing SQL scripts much easier. They al

Re: [GENERAL] IF EXISTS

2006-09-20 Thread Jeff Davis
On Wed, 2006-09-20 at 14:18 -0700, stevethames wrote: > I have a script that sets up my databases which I run whenever I change any > of the functions. It has a number of things it does that are unnecessary > and cause errors. I create some types, sequences, etc. The error messages > are irritat

[GENERAL] IF EXISTS

2006-09-20 Thread stevethames
I have a script that sets up my databases which I run whenever I change any of the functions. It has a number of things it does that are unnecessary and cause errors. I create some types, sequences, etc. The error messages are irritating. I'd like to do something like this: IF NOT EXISTS (SEL

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Samer Abukhait
How about if exists (select .. from ..) On 11/14/05, Jaime Casanova <[EMAIL PROTECTED]> wrote: > On 11/14/05, P.M <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I would like to know if "IF EXISTS" exists under > > postgresql ? > > because i did not find it. > > > > before to create users or database,

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Jaime Casanova
On 11/14/05, P.M <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if "IF EXISTS" exists under > postgresql ? > because i did not find it. > > before to create users or database, i would like to be > sure that they do not exist already. > > so how can i test it and do something like : > > I

Re: [GENERAL] IF EXISTS

2005-11-14 Thread Bruno Wolff III
On Mon, Nov 14, 2005 at 13:20:59 -0800, "P.M" <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if "IF EXISTS" exists under > postgresql ? > because i did not find it. > > before to create users or database, i would like to be > sure that they do not exist already. > > so how can i tes

[GENERAL] IF EXISTS

2005-11-14 Thread P.M
Hi, I would like to know if "IF EXISTS" exists under postgresql ? because i did not find it. before to create users or database, i would like to be sure that they do not exist already. so how can i test it and do something like : IF EXISTS database "test" DROP database "test"; thanks a lot, Ma

[GENERAL] IF EXISTS?

2003-11-02 Thread Henrik W. Hansen
Hi all Can I make something linke: IF EXISTS(company_id_seq) DROP SEQUENCE company_id_seq; in a DDL where i creates all my tables? /Henrik ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster