How to add primary key to View?

Viewed 22562

I have a view and want to make one attribute a primary key.

CREATE VIEW filedata_view
AS SELECT num PRIMARY KEY, id, ST_TRANSFORM(the_geom,900913) AS the_geom
FROM filedata

But get a error

ERROR:  syntax error at or near "PRIMARY"
LINE 2: AS SELECT num PRIMARY KEY, id, ST_TRANSFORM(the_geom,900913)...

How to do this?

2 Answers
Related