Skip to content

pcpoint column listed twice in pointcloud_columns #27

Description

@strk

I've created a table with a no typ-moded pcpoint column (ppoints.pt), then another (ppoints2.pt) with a typ-mod'ed one. When pointcloud_formats was empty, pointcloud_columns was also empty. When I inserted a pcid=1 in pointcloud_formats I saw a single entry for ppoints.pt, when I also inserted a pcid=2 in pointcloud_formats I saw two (2) entries for ppoints.pt and one for ppoints2.pt, as shown below:

strk=# select * from pointcloud_columns;
 schema |  table   | column | pcid | srid |  type   
--------+----------+--------+------+------+---------
 public | ppoints  | pt     |      | 4326 | pcpoint
 public | ppoints  | pt     |      | 4326 | pcpoint
 public | ppoints2 | pt     |    2 | 4326 | pcpoint
(3 rows)

strk=# \d ppoints
                         Table "public.ppoints"
 Column |  Type   |                      Modifiers                       
--------+---------+------------------------------------------------------
 id     | integer | not null default nextval('ppoints_id_seq'::regclass)
 pt     | pcpoint | 
Indexes:
    "ppoints_pkey" PRIMARY KEY, btree (id)

The view definition:

strk=# \d+ pointcloud_columns;
           View "public.pointcloud_columns"
 Column |  Type   | Modifiers | Storage | Description 
--------+---------+-----------+---------+-------------
 schema | name    |           | plain   | 
 table  | name    |           | plain   | 
 column | name    |           | plain   | 
 pcid   | integer |           | plain   | 
 srid   | integer |           | plain   | 
 type   | name    |           | plain   | 
View definition:
 SELECT n.nspname AS schema,
    c.relname AS "table",
    a.attname AS "column",
    pc_typmod_pcid(a.atttypmod) AS pcid,
    p.srid,
    t.typname AS type
   FROM pg_class c,
    pg_attribute a,
    pg_type t,
    pg_namespace n,
    pointcloud_formats p
  WHERE (t.typname = ANY (ARRAY['pcpatch'::name, 'pcpoint'::name])) AND a.attisdropped = false AND a.atttypid = t.oid AND a.attrelid = c.oid AND c.relnamespace = n.oid AND (pc_typmod_pcid(a.atttypmod) = p.pcid OR pc_typmod_pcid(a.atttypmod) IS NULL) AND NOT pg_is_other_temp_schema(c.relnamespace) AND has_table_privilege(c.oid, 'SELECT'::text);

Version of pg_pointcloud:

strk=# select pc_version();
 pc_version 
------------
 1.0.0
(1 row)

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions