Home > Archive > PostgreSQL Discussion > April 2006 > what datatype is for autonumbering.in postgress









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author what datatype is for autonumbering.in postgress
deepak pal

2006-04-04, 3:27 am

hi
i have to make ine field autonumber field what datatype should be used..??
plz reply meee..
On 4/3/06, William Leite Araújo <william.bh@gmail.com> wrote:
> You can make a function to do this.
>
> CREATE FUNCTION drop_operators(text)
RETURNS BOOL AS
> $$
> DECLARE
> op record;
> BEGIN
> FOR op IN SELECT opname
> FROM pg_operator as o left join pg_namespace as n on (
> o.oprnamespace = n.oid)
> WHERE nspname = $1
> LOOP
> EXECUTE 'DROP OPERATOR '||quote_literal(op.opname)||';';
> END LOOP;
> RETURN TRUE;
> END;
> $$ LANGUAGE 'plpgsql' IMMUTABLE;
>
> And so: SELECT drop_operators('publ
ic');
>
> On 3/31/06, Martin Pohl <Nilpherd@gmx.net> wrote:
>
>
>
> --
> William Leite Araújo
>
>


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Chris

2006-04-04, 3:27 am

deepak pal wrote:
> hi
> i have to make ine field autonumber field what datatype should be used..??


serial.

http://www.postgresql.org/docs/8.1/...DATATYPE-SERIAL

--
Postgresql & php tutorials
http://www.designmagick.com/

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

A. Kretschmer

2006-04-04, 3:27 am

am 04.04.2006, um 10:07:58 +0530 mailte deepak pal folgendes:
> hi
> i have to make ine field autonumber field what datatype should be used..??
> plz reply meee..


You can use serial data types for this, read
http://www.postgresql.org/docs/8.1/...DATATYPE-SERIAL

[color=darkred]
> On 4/3/06, William Leite Araújo <william.bh@gmail.com> wrote:

Please, no silly fullquote below your question.


HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com