On Fri, 2005-11-04 at 15:49, Marc Boucher wrote:
> At 11:49 04/11/2005 -0500, Alex Turner wrote:
> > I think he meant
> >
> > create sequence test_seq;
> > select setval('test_seq',(select max(primary_key_id) from my_table));
> >
> > not max value of a serial type.
>
> What I understand, and from
At 11:49 04/11/2005 -0500, Alex Turner wrote:
> I think he meant
>
> create sequence test_seq;
> select setval('test_seq',(select max(primary_key_id) from my_table));
>
> not max value of a serial type.
What I understand, and from what I know by using mysql, is that mysql
auto-adjust the max value
Steven Brown <[EMAIL PROTECTED]> writes:
> I'm granting access to insert/update/delete rows of a table to people,
> but I don't want all future inserts to fail if they decided to change an
> id (which they obviously shouldn't, but they /can/). It makes for a
> fragile system.
create rule no_p
I think he meant
create sequence test_seq;
select setval('test_seq',(select max(primary_key_id) from my_table));
not max value of a serial type.
Alex
On 11/3/05, Marc Boucher <[EMAIL PROTECTED]> wrote:
> On Wed, 02 Nov 2005 19:29:10 -0800, you wrote:
>
> >It's a migration thing - MySQL prevente
Steven Brown wrote:
> When I change an id (primary key serial) in a table, the next value
> returned by the sequence for the id can conflict with that id (e.g.,
> change the id to be id + 1). [...]
If you're doing this to have a custom ordering of your data, consider adding
another int column wit
On Wed, 02 Nov 2005 19:29:10 -0800, you wrote:
>It's a migration thing - MySQL prevented this
>situation due to the way it handles auto_increment (it will never assign
>you an id that already exists).
AFAIK, in mysql, if you modify a serial by setting it to the max value for
this type, mysql wi
[snip]
On Thu, 2005-11-03 at 18:02, [EMAIL PROTECTED] wrote:
> Strange - I had never realized that PostgreSQL would allow you to UPDATE a
> primary key value. I thought that other db's I had used (e.g. Sybase,
> Oracle, SQL Server, etc.) in the past would not allow that, and you had to
> DELETE, t
MAIL PROTECTED]>
Sent by: cc:
pgsql-general@postgresql.org
Subject: Re: [GENERAL]
Changing ids conflicting w
Steven Brown <[EMAIL PROTECTED]> writes:
> I'm granting access to insert/update/delete rows of a table to people,
> but I don't want all future inserts to fail if they decided to change
> an id (which they obviously shouldn't, but they /can/). It makes for
> a fragile system.
If it shouldn't hap
Steven Brown wrote:
When I change an id (primary key serial) in a table, the next value
returned by the sequence for the id can conflict with that id (e.g.,
change the id to be id + 1). MySQL seems to handle this transparently
by skipping conflicting values, but with PostgreSQL I get primary
Tom Lane wrote:
Steven Brown <[EMAIL PROTECTED]> writes:
When I change an id (primary key serial) in a table, the next value
returned by the sequence for the id can conflict with that id (e.g.,
change the id to be id + 1).
[...]
Plan A: don't do that. Why in the world is it a good idea to mo
Steven Brown <[EMAIL PROTECTED]> writes:
> When I change an id (primary key serial) in a table, the next value
> returned by the sequence for the id can conflict with that id (e.g.,
> change the id to be id + 1). MySQL seems to handle this transparently
> by skipping conflicting values, but wit
When I change an id (primary key serial) in a table, the next value
returned by the sequence for the id can conflict with that id (e.g.,
change the id to be id + 1). MySQL seems to handle this transparently
by skipping conflicting values, but with PostgreSQL I get primary key
conflicts. It se
13 matches
Mail list logo