Entries in namespace (3)

How do I delete a function in namespace .z?

The usual way to delete a function - any entity, for that matter, is

delete entity from namespace

e.g.

delete foo from `.

However, .z is a special namespace, so delete doesn't work:

q).z.ts: {47}
q)delete ts from `.z
'type
q)

There is a special command just for removing elements from .z:

q)\x .z.pi

See \x (expunge).

How can I find a listing of tables in a given namespace?

To list the tables in the current namespace, use \a; to list the tables from a specific namespace, both \a namespace and tables `namespace work:

$ q sp.q
KDB+ 2.7 2011.02.16 Copyright © 1993-2011 Kx Systems
+`p`city!(`p$`p1`p2`p3`p4`p5`p6`p1`p2;`london`london`london`l..
(+(,`color)!,`blue`green`red)!+(,`qty)!,900 1000 1200
+`s`p`qty!(`s$`s1`s1`s1`s2`s3`s4;`p$`p1`p4`p6`p2`p2`p4;300 200 100 400 200 300)
q)\a
`p`s`sp
q)\a .
`p`s`sp
q)tables `.
`p`s`sp
q)

Is it possible to hold partitioned table and unpartitioned table named the same on a single kdb process?

No. Because they share the same namespace, you can only have one type or the other.