Skip to content

Commit da51e4e

Browse files
committed
use name as id
1 parent bb681f2 commit da51e4e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

demo/initdb/04-views.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CREATE TABLE cities (
2-
id serial PRIMARY KEY,
3-
name text,
2+
name text PRIMARY KEY,
43
geom geometry(Point, 4326)
54
);
65

@@ -10,5 +9,5 @@ INSERT INTO cities (name, geom) VALUES
109

1110
-- View with geometry and featureID column (no PK)
1211
CREATE VIEW cities_view AS
13-
SELECT id AS id, name, geom FROM cities;
12+
SELECT name as id, * FROM cities;
1413

0 commit comments

Comments
 (0)