Re: not null

From: Matthew Horoschun <mhoroschun(at)canprint(dot)com(dot)au>
To: ryanne cruz <ryanne(dot)cruz(at)up(dot)edu(dot)ph>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: not null
Date: 2003-01-25 12:55:16
Message-ID: 40576D7E-3064-11D7-9D1C-000393B3A702@canprint.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi Ryanne,

As already suggested, a SERIAL is just an column that has a default of
the nextval() of an implicitly defined SEQUENCE.

So, try:

ALTER TABLE table_name ALTER COLUMN column_name SET DEFAULT
nextval('column_name_seq'::text);
CREATE SEQUENCE column_name_seq;

Cheers

Matthew.

On Saturday, January 25, 2003, at 10:52 PM, ryanne cruz wrote:

>
> hi list.
>
> i have a column that has a "not null" as its modifier. is there a way
> that i
> can remove that? or better yet to make it a "serial not null"?

--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.

--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.

Mobile: 0417 282 378
Direct: (02) 6295 4544
Telephone: (02) 6295 4422
Facsimile: (02) 6295 4473

In response to

  • not null at 2003-01-25 11:52:40 from ryanne cruz

Browse pgsql-php by date

  From Date Subject
Next Message Matthew Horoschun 2003-01-25 12:59:59 Re: not null
Previous Message ryanne cruz 2003-01-25 11:52:40 not null