Title: RE: [GENERAL] serial column
Yes, but if I tear down the house at 245 Main St, we don't renumber 247 Main St and on down the line, do we?
The problem here is that even if you get the sequencing to work, your table is dangerously unstable. If you have 700 rows and you delete row
mailto:[EMAIL PROTECTED]
Sent: Monday, September 25, 2006 12:00 PM
To: Brandon Aiken; pgsql-general@postgresql.org
Subject: Re: [GENERAL] serial column
Actually, I am not trying to "force keys" nor, I don't beleive, am I
trying
to force an hierarchal structure within the database.
On Mon, 2006-09-25 at 00:19 +0200, Gevik Babakhani wrote:
> On Sun, 2006-09-24 at 14:49 -0700, Bob Pawley wrote:
> > It's the behavior I expect - but the gaps aren't acceptable.
> >
> > Bob
>
> Then using the SERIAL or SEQUENCE won't do you any good.
>
> A possible solution for this would be to
e lowest serial ID number. )
Thanks for your comments - everything helps at my stage.
Bob Pawley
- Original Message -
From: "Brandon Aiken" <[EMAIL PROTECTED]>
To:
Sent: Monday, September 25, 2006 7:47 AM
Subject: Re: [GENERAL] serial column
I would tend to
do relationships it doesn't know about, so you technically violate first
normal form by having a multi-valued field (it identifies uniqueness and
order).
--
Brandon Aiken
CS/IT Systems Engineer
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of To
a gap.
>
> Perhaps a manually built table is the answer??
>
> Bob
>
>
> - Original Message -
> From: "Tom Lane" <[EMAIL PROTECTED]>
> To: "Bob Pawley" <[EMAIL PROTECTED]>
> Cc: "Ragnar" <[EMAIL PROTECTED]>; "
uot;
Sent: Sunday, September 24, 2006 4:30 PM
Subject: Re: [GENERAL] serial column
Bob Pawley <[EMAIL PROTECTED]> writes:
I am using the numbers to identify devices.
If a device is deleted or replaced with another type of device I want the
numbering to still be sequential.
It sounds to me l
D]>
To:
Cc: "Bob Pawley" <[EMAIL PROTECTED]>
Sent: Sunday, September 24, 2006 6:11 PM
Subject: Re: [GENERAL] serial column
On Sunday 24 September 2006 02:29 pm, Bob Pawley wrote:
Choice a.
I am using the numbers to identify devices.
If a device is deleted or replaced with anothe
On Sunday 24 September 2006 02:29 pm, Bob Pawley wrote:
> Choice a.
>
> I am using the numbers to identify devices.
>
> If a device is deleted or replaced with another type of device I want the
> numbering to still be sequential.
>
> Bob
>
Do you have some other way of tracking a device? I am just
Thanks
I'll give that a try.
Bob
- Original Message -
From: "Gevik Babakhani" <[EMAIL PROTECTED]>
To: "Bob Pawley" <[EMAIL PROTECTED]>
Cc: "Postgresql"
Sent: Sunday, September 24, 2006 4:13 PM
Subject: Re: [GENERAL] serial column
On S
Bob Pawley <[EMAIL PROTECTED]> writes:
> I am using the numbers to identify devices.
> If a device is deleted or replaced with another type of device I want the
> numbering to still be sequential.
It sounds to me like you oughtn't be storing these numbers in the
database at all. You just want to
On Sun, 2006-09-24 at 15:29 -0700, Bob Pawley wrote:
> "A possible solution for this would be to regenerate the entire column's
> values every time a record gets deleted starting form 1. but then again
> this would be very slow if you have a very large table"
>
> I don't anticipate the table to be
ot;
Sent: Sunday, September 24, 2006 3:19 PM
Subject: Re: [GENERAL] serial column
On Sun, 2006-09-24 at 14:49 -0700, Bob Pawley wrote:
It's the behavior I expect - but the gaps aren't acceptable.
Bob
Then using the SERIAL or SEQUENCE won't do you any good.
A possible solut
Do you have a for instance??
Bob
- Original Message -
From: "Ragnar" <[EMAIL PROTECTED]>
To: "Bob Pawley" <[EMAIL PROTECTED]>
Cc: "Postgresql"
Sent: Sunday, September 24, 2006 3:10 PM
Subject: Re: [GENERAL] serial column
On sun, 2006-09-24
On Sun, 2006-09-24 at 14:49 -0700, Bob Pawley wrote:
> It's the behavior I expect - but the gaps aren't acceptable.
>
> Bob
Then using the SERIAL or SEQUENCE won't do you any good.
A possible solution for this would be to regenerate the entire column's
values every time a record gets deleted sta
On sun, 2006-09-24 at 14:29 -0700, Bob Pawley wrote:
> Choice a.
>
> I am using the numbers to identify devices.
>
> If a device is deleted or replaced with another type of device I want the
> numbering to still be sequential.
have you tried to implement ths using
triggers?
gnari
--
It's the behavior I expect - but the gaps aren't acceptable.
Bob
- Original Message -
From: "Gevik Babakhani" <[EMAIL PROTECTED]>
To: "Bob Pawley" <[EMAIL PROTECTED]>
Cc: "Postgresql"
Sent: Sunday, September 24, 2006 2:42 PM
S
esolve.
>
> Bob
>
> - Original Message -
> From: "Gevik Babakhani" <[EMAIL PROTECTED]>
> To: "Bob Pawley" <[EMAIL PROTECTED]>
> Cc: "Postgresql"
> Sent: Sunday, September 24, 2006 2:00 PM
> Subject: Re: [GENERAL] ser
CTED]>
Cc: "Postgresql"
Sent: Sunday, September 24, 2006 2:24 PM
Subject: Re: [GENERAL] serial column
On sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote:
I need to develop a serial column that always starts at 1 and is
sequential even after deletes.
what exactly do you mean?
On sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote:
> I need to develop a serial column that always starts at 1 and is
> sequential even after deletes.
what exactly do you mean?
say you have rows where your
columns has values 1,2,3 and 4.
you now delete the row where
the value is 2.
what do yo
akhani" <[EMAIL PROTECTED]>
To: "Bob Pawley" <[EMAIL PROTECTED]>
Cc: "Postgresql"
Sent: Sunday, September 24, 2006 2:00 PM
Subject: Re: [GENERAL] serial column
On Sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote:
I need to develop a serial column that always sta
On Sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote:
> I need to develop a serial column that always starts at 1 and is
> sequential even after deletes.
>
> Any ideas???
>
Did you try the:
create table tbl
(
id SERIAL
);
or even with primary key...
create table tbl
(
id SERI
I need to develop a serial column that always starts at 1
and is sequential even after deletes.
Any ideas???
Bob
The answer is 3. Mistake of mine. I put in a field of the same name to
display it, and it was also sending 0 with the statement.
Thank you for helping me get to the bottom of it.
Malcolm Warren
Richard Huxton wrote:
Malcolm Warren wrote:
Thank you for your reply.
Yes, I get the next number and th
Malcolm Warren wrote:
I have been using a serial column in my most important postgres table
for a couple of years.
But today it has suddenly started assigning zero instead of the next
number, which clearly is causing chaos.
I have restarted Postgres, but it has not solved the problem. I cannot
I have been using a serial column in my most important postgres table
for a couple of years.
But today it has suddenly started assigning zero instead of the next
number, which clearly is causing chaos.
I have restarted Postgres, but it has not solved the problem. I cannot
re-assign the serial n
26 matches
Mail list logo