Re: SERIAL type - auto-increment grouped by other field

From: elein <elein(at)varlena(dot)com>
To: elein <elein(at)varlena(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL type - auto-increment grouped by other field
Date: 2004-03-01 21:00:56
Message-ID: 20040301130056.F4303@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You just need to define 'plpgsql' as a language in
your database. At the shell, to define the language use:

createlang 'plpgsql' <dbname>;

After you do the createlang, you can write functions
using plpgsql.

Let me know if you are still having trouble.

--elein
>
> On Mon, Mar 01, 2004 at 09:52:33PM +0100, Paulovi?? Michal wrote:
> > tnx a lot,
> >
> > but i am using PostgreSQL 7.1.2 and your script result errors:
> > -------
> > ERROR: Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
> > Recognized languages are sql, C, internal, and created procedural languages.
> > -------
> >
> > elein wrote:
> >
> > >One possible implementation of a two level numbering outline
> > >will be published in PostgreSQL GeneralBits Issue #64 due
> > >out Monday morning, 3/1. http://www.varlena.com/GeneralBits/
> > >
> > >elein
> > >============================================================
> > >elein(at)varlena(dot)com Varlena, LLC www.varlena.com
> > > 1-866-VARLENA
> > > PostgreSQL Consulting, Support & Training
> > >
> > >PostgreSQL General Bits http://www.varlena.com/GeneralBits/
> > >=============================================================
> > >Its a doggy dog world out there.
> > >
> > >
> > >On Sun, Feb 29, 2004 at 02:44:01AM +0100, Paulovi? Michal wrote:
> > >
> > >
> > >>hi all,
> > >>
> > >>I have problem with SERIAL field type (or sequence functionality).
> > >>I have table with three columns - ID, IDS, NAME.
> > >>I want auto-increment IDS grouped by ID.
> > >>Example:
> > >>1, 1, Ferdo
> > >>1, 2, John
> > >>2, 1, Martin
> > >>1, 3, Elvira
> > >>2, 2, Georgia
> > >>
> > >>but...
> > >>when I use IDS - SERIAL and when I create UNIQUE (ID, IDS) result is:
> > >>1, 1, Ferdo
> > >>1, 2, John
> > >>2, 3, Martin
> > >>1, 4, Elvira
> > >>2, 5, Georgia
> > >>
> > >>where i make misstake??? how can i do it??? in documentation there is
> > >>description only for one auto-increment column. I didn't find auto
> > >>increment as
> > >>I described upper. Do you have any idea how can I do it???
> > >>
> > >>tnx a lot
> > >>
> > >>
> > >>________ Information from NOD32 ________
> > >>This message was checked by NOD32 Antivirus System for Linux Mail Server.
> > >>http://www.nod32.com
> > >>
> > >>---------------------------(end of broadcast)---------------------------
> > >>TIP 2: you can get off all lists at once with the unregister command
> > >> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> > >>
> > >>
> > >
> > >
> > >________ Information from NOD32 ________
> > >This message was checked by NOD32 Antivirus System for Linux Mail Server.
> > >http://www.nod32.com
> > >
> > >
> > >

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paulovič Michal 2004-03-01 21:17:45 Re: SERIAL type - auto-increment grouped by other field
Previous Message Bill Moran 2004-03-01 20:59:08 Re: using the "copy from" command to load tables from a