Re: How do I recognize a system catalog table?
Posted in 1997
In article <34842680.D2AB37A1@garpac.com>, Jacob Salomon
<jake@garpac.com> writes
>|| : Quote from Jake's original message
>| : Quote from Madison's response
>
>Madison (AKA SaTriGuy) wrote:
>||The only possibility seems to be in the ti_flags column of systabinfo.
>||without really rigorous checking, it seems that the ti_flags column
>||for a system catalog has the 0x2 bit turned on; non-catalogs seem to
>||have the 0x1 bit and temp tables in the bogus SORTTEMP database seem
>||to have these bits turned off.
>||
>||Q1:
>||Can anyone confirm - with true knowledge - that I have come to a
>||correct conclusion regarding these flags?
>|
>| Wrong - those are the page/row locking
>
>Thanks but that still leaves me wondering how to recognize a catalog,
>since these last 2 bits are not the key I seek. I notice (with one
>arched eyebrow ;-) you did not answer Q2, repeated below..
>
Look at $INFORMIXDIR/etc/sysmaster.sql.
Cannot you somehow get to sysmaster:sysdatabase and then check within
systables for that database? Or check the partnum for the table
against all tables in all databases in sysmaster..
I would add more but I'm in Win95 now and sysmaster.sql is on my Linux
partition..
>||Q2:
>||Carrying this to an unsurprising follow-up: Does anyone have genuine
>||information (read: Documentation) on what in *&^%! these flags all
>||stand for? It's not in the FM. (That's the fine manual - get your
>||mind out of the gutter! ;-)
>
>As for Q3:
>||Q3:
>||Assuming my empirical conclusion to be correct regarding that low two
>||bits of ti_flags, what kind of expression can I use to isolate this
>||digit?
>|
>| Try select bitval(ti_flags, 1) from systabinfo
>
>Thanks! Exactly what I needed. But I don't see it documented in the
>Guide to SQL Syntax. When I experimented with it I deliberately added a
>third parameter, I incurred an error:
> 694: Too many arguments passed to procedure (informix.bitval).>Interesting! So bitval() is *not* an SQL function; it is a stored
>procedure in the sysmaster database. I think these procedures are in
>need of documentation!
>
>Madison added:
>
>|The catalog tables for sysmaster still have the tabid < 99 business.
>|The pseudo tables have a partition number < 1048576 (0x0100000).
>|The views have a tabtype of "V"
>
>This would be helpful if I were accessing the catalogs directly. I am
>not; I am getting all table information from the sysmaster database.
>
>I just realized I am making the assumption that sysmaster treats system
>catalogs differently from regular tables. This is a reasonable
>assumption but not necessarily correct.
>
>So who will set me straight on this issue? *Is* there a special way to
>recognize a catalog from ti_flags in systabinfo?
>
>Thanks.
--
David Williams