On Nov 6, 2007, at 1:15 AM, Raymond O'Donnell wrote:
On 06/11/2007 08:54, Reg Me Please wrote:
What'd be the syntax to create a primary key on an already build
table?
ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY (f1);
So, ALTER TABLE test ADD PRMARY KEY(f1 [, ... ] )
isn't
On 06/11/2007 08:54, Reg Me Please wrote:
What'd be the syntax to create a primary key on an already build table?
ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY (f1);
http://www.postgresql.org/docs/8.2/static/sql-altertable.html
Hi all.
What'd be the syntax to create a primary key on an already build table?
Thanks.
--
Reg me Please
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
On Tue, Nov 06, 2007 at 01:38:31AM -0800, Samantha Atkins wrote:
On Nov 6, 2007, at 1:15 AM, Raymond O'Donnell wrote:
On 06/11/2007 08:54, Reg Me Please wrote:
What'd be the syntax to create a primary key on an already build
table?
ALTER TABLE test ADD CONSTRAINT test_pk PRIMARY KEY
Reg Me Please wrote:
Hi all.
What'd be the syntax to create a primary key on an already build table?
Hmm - so you want to sort of alter a table and add a primary key
constraint to an existing column?
ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);
All in the manuals:
On 06/11/2007 09:38, Samantha Atkins wrote:
So, ALTER TABLE test ADD PRMARY KEY(f1 [, ... ] )
isn't enough? It appears in the examples. What more does the explicit
test_pk do that wouldn't happen anyway?
confession
To make sure I got it right, I tried it out using PgAdmin and copied the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 11/06/07 03:15, Richard Huxton wrote:
Reg Me Please wrote:
Hi all.
What'd be the syntax to create a primary key on an already build table?
Hmm - so you want to sort of alter a table and add a primary key
constraint to an existing column?
Reg Me Please wrote:
What'd be the syntax to create a primary key on an already
build table?
As described in the documentation:
ALTER TABLE name ADD [CONSTRAINT constraint name]
PRIMARY KEY (colname [, ...])
[WITH (FILLFACTOR = number)] [USING INDEX TABLESPACE tbsp name]
Yours,
Laurenz Albe
Albe Laurenz wrote:
Richard Huxton wrote:
What'd be the syntax to create a primary key on an already
build table?
ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);
I'm sure it's just a typo, but that is wrong.
It is not ADD PRIMARY CONSTRAINT, but ADD PRIMARY KEY.
It is indeed
Richard Huxton wrote:
What'd be the syntax to create a primary key on an already
build table?
ALTER TABLE my_table ADD PRIMARY CONSTRAINT (existing_column);
I'm sure it's just a typo, but that is wrong.
It is not ADD PRIMARY CONSTRAINT, but ADD PRIMARY KEY.
Yours,
Laurenz Albe
10 matches
Mail list logo