Re: A couple of newbie questions ...

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: A couple of newbie questions ...
Date: 2008-07-23 10:16:56
Message-ID: 20080723101655.GD28492@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am Wed, dem 23.07.2008, um 19:18:15 +0930 mailte admin folgendes:
> 1. Is a SEQUENCE what I use instead of auto_increment?

Yes.

>
> 2. Does this work in PostgreSQL:
>
> INSERT INTO table VALUES ('x','y','z')
>
> or do I need to do this
>
> INSERT INTO table (fld_x,fld_y,fld_z) VALUES ('x','y','z')

Both worked, but it is better to list the columns. If you change later
the table-design, the first (without column-list) insert fails.

>
> ?
>
> 3. Does this work in PostgreSQL:
>
> INSERT INTO table VALUES ('','y','z')
>
> where the empty first item is intended for an auto_increment/SEQUENCE id
> field?
> If not, what is an alternative?

Use 'default' instead (without the ') or omit this column in the
column-list.

HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Sigaev 2008-07-23 11:36:28 Re: [GENERAL] Fragments in tsearch2 headline
Previous Message Karsten Hilbert 2008-07-23 10:16:46 Re: A couple of newbie questions ...