Re: CREATE TABLE LIKE and SERIAL

From: silly8888 <silly8888(at)gmail(dot)com>
To: Mark Morgan Lloyd <markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TABLE LIKE and SERIAL
Date: 2009-10-30 17:03:39
Message-ID: 3c8f9f940910301003m55e454ag3bb41a3d36a90daf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-general

In 8.4, the sequence value is copied only when INCLUDING DEFAULTS is
specified. Otherwise, only the not null constraint is copied. I think
this is the most reasonable behavior and I don't see why it should
have been explicitly stated in the manual.

On Fri, Oct 30, 2009 at 8:44 AM, Mark Morgan Lloyd
<markMLl(dot)pgsql-general(at)telemetry(dot)co(dot)uk> wrote:
> What is the "correct" behavior of a serial column when a table is created
> with LIKE? The manual is silent on this.
>
> What appears to be happening with 8.2 is that the column in the new table
> refers to the original sequence generator.
>
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
>
> [Opinions above are the author's, not those of his employers or colleagues]
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Mark Morgan Lloyd 2009-10-30 18:21:30 Re: CREATE TABLE LIKE and SERIAL
Previous Message Dave Page 2009-10-30 13:24:59 Re: [ADMIN] pgAdmin 1.10, OSX 10.6 problem

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2009-10-30 17:42:56 Re: Correlated Subquery and calculated column non-functional
Previous Message Sam Mason 2009-10-30 14:48:20 Re: Absolute value of intervals