Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-07 Thread Michelle Konzack
Halle Craig, Am 2008-11-05 20:37:31, schrieb Craig Ringer: If you really, truly need gapless sequences, there are some options. I posted about them recently on another thread. The archives will contain that post and many others from many people on the same topic. Be aware, though, that

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-07 Thread Craig Ringer
Michelle Konzack wrote: Halle Craig, Am 2008-11-05 20:37:31, schrieb Craig Ringer: If you really, truly need gapless sequences, there are some options. I posted about them recently on another thread. The archives will contain that post and many others from many people on the same topic.

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-07 Thread Michelle Konzack
Hi again, Am 2008-11-05 20:13:40, schrieb Craig Ringer: Michelle Konzack wrote: OK, you hit me, I am trying to convert a mysql scheme to postgresql... OK, in the same time I am trying to make programs like os-commerce PostgreSQL usable Realy, I hate programs which relay on ONE

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-07 Thread Craig Ringer
Michelle Konzack wrote: The ONLY real option would be, go to a HostingProvider which VERY good and reliabel Internet connectivity and install there my WHOLE PostgreSQL database and let my other websites access them over the internet... ... making them subject to problems with transit

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-06 Thread Bruce Momjian
Michelle Konzack wrote: -- Start of PGP signed section. Hello Michael, Am 2008-10-31 11:15:54, schrieb Michael Hall: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-06 Thread Scott Marlowe
On Sat, Nov 1, 2008 at 12:33 PM, Michelle Konzack [EMAIL PROTECTED] wrote: Hello Michael, Am 2008-10-31 11:15:54, schrieb Michael Hall: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Michelle Konzack
Hello Michael, Am 2008-10-31 11:15:54, schrieb Michael Hall: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? Have a look in the manual for the SERIAL data

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Michelle Konzack
Hello Nikolas, Am 2008-10-31 09:44:50, schrieb Nikolas Everett: I think you want a sequence. Give the serial number the type bigserial or serial. See http://www.postgresql.org/docs/current/static/functions-sequence.html for more. OK, thats cool... I have found an example in

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Michelle Konzack
Hello Grzegorz, Am 2008-10-31 13:39:46, schrieb Grzegorz Ja??kiewicz: AUTOINCREMENT has so many problems, that soon you'll start to love sequences so much, you'll start to hate mysql's childlish approach to problem solving :) OK, you hit me, I am trying to convert a mysql scheme to

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Craig Ringer
Michelle Konzack wrote: Hello Grzegorz, Am 2008-10-31 13:39:46, schrieb Grzegorz Ja??kiewicz: AUTOINCREMENT has so many problems, that soon you'll start to love sequences so much, you'll start to hate mysql's childlish approach to problem solving :) OK, you hit me, I am trying to convert a

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Joshua Tolley
On Sat, Nov 01, 2008 at 02:24:37PM +0100, Michelle Konzack wrote: Du I need to create a SEQUENCE for each table or do I need only ONE of if and can use it independant on differnt tables? If you just create a bunch of tables with SERIAL or BIGSERIAL columns, it will create one sequence for

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Craig Ringer
Michelle Konzack wrote: Hello Michael, Am 2008-10-31 11:15:54, schrieb Michael Hall: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? Have a look in the manual

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-11-05 Thread Albe Laurenz
Michelle Konzack wrote: I think you want a sequence. Give the serial number the type bigserial or serial. See http://www.postgresql.org/docs/current/static/functions-sequence.html for more. OK, thats cool... I have found an example in sql-createsequence.html CREATE SEQUENCE serial

[GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread Michelle Konzack
Hello, I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? There was a message for some month a message describing it on this list but I do not find the message

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread Grzegorz Jaśkiewicz
# create table foo( a SERIAL ); NOTICE: CREATE TABLE will create implicit sequence foo_a_seq for serial column foo.a CREATE TABLE # \d+ foo Table public.foo Column | Type | Modifiers | Description +-+-+- a | integer |

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread Sam Mason
On Fri, Oct 31, 2008 at 03:30:44AM +0100, Michelle Konzack wrote: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? Just don't mention the column. For example,

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread Grzegorz Jaśkiewicz
pardon me, I didn't read the post - just judged it by subject really :) you can also use keyward DEFAULT, so insert into foo(a) values(default); But that's the whole point of DEFAULT in create table statement. If you omit that column, it will be set to default value.

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread Michael Hall
I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? Have a look in the manual for the SERIAL data type. For fields with a SERIAL data type, you can use DEFAULT in

Re: [GENERAL] Equivalent for AUTOINCREMENT?

2008-10-31 Thread D. Dante Lorenso
Michelle Konzack wrote: I have a table where I have a serialnumber which shuld be increased be each INSERT. I know I can use max() to get the highest number, but how can I use it in a INSERT statement? There was a message for some month a message describing it on this list but I do not