Re: Auomatic numbering, replacing nulls and IF

From: "Pestilence" <me(at)work(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Auomatic numbering, replacing nulls and IF
Date: 2002-03-14 20:58:22
Message-ID: 3c910ecc$1@news.nz.asiaonline.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

OK, Answered my own question #1:
Data type SERIAL or using CREATE SEQUENCE.

--

Luke Pascoe

"Pestilence" <me(at)work(dot)com> wrote in message
news:3c910d7d$1(at)news(dot)nz(dot)asiaonline(dot)net(dot)(dot)(dot)
> I'm a child of Oracle and MS-SQL (forgive me) and have only been playing
> with Postgres for a few days. I have 3 questions that I couldn't find
> answers for in the online docs:
>
> 1) Is it possible to create an INT PRIMARY KEY column that automagically
> numbers itself? MS-SQL does this using the IDENTITY keyword.
>
> 2) The ISNULL function in both Oracle and MS-SQL takes 2 numbers and
returns
> the second if the first is null, otherwise it returns the first. ISNULL in
> Postgres seems to be something quite different. Before I go writing my own
> function to do it, is there one already?
>
> 3) How do I do 'IF this_sql THEN that_sql'? I keep getting:
> parse error at or near "IF"
> --
>
> ================================
> Luke Pascoe
> Senior Developer
> IT Support & Development Limited
> http://wwwitsd.co.nz
> Mobile: (021) 303019
> Email: luke(at)itsd(dot)co(dot)nz
> ================================
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2002-03-14 21:23:08 Re: FAQ -- 'cache lookup failed' still a puzzle
Previous Message Pestilence 2002-03-14 20:52:46 Auomatic numbering, replacing nulls and IF