Stefen Hillman <stefen.hillman@xxxxxxxxxxxx> writes: > Currently, I process Relation messages to get most of the information I > need to work with Inserts, Updates, and Deletes. However, for type > information I'm currently using a SQL query to get the column type > information. I wanted to use the Type messages, but I never see them. I see > Begin, Commit, etc. but never Type. > - When are the Type messages generated and sent by the server? > - Is there a way to cause them to be generated? Hmm. AFAICS the Type messages are completely undocumented in protocol.sgml, which is an oversight. Looking at the code, they do exist, but they are sent only when a Relation message refers to a non-built-in type. There's a presumption that built-in types have stable OIDs that will be the same at publisher and subscriber, so the replication traffic needn't tell the subscriber what those OIDs mean. Non-built-in types don't have stable OIDs, so we want to tell the subscriber what those OIDs mean. (Actually, it looks like the cutoff is FirstGenbkiObjectId, which means that the Type message is only suppressed for hand-assigned type OIDs, an even stricter rule than "built in". So for testing purposes you could try something like an array type; replicating a table with an array column should give rise to Type messages.) > - Are these type id > type mappings set in stone, or does PostgreSQL > allow for a server to have custom types (I notice that namespace is one of > the properties sent with the types)? Some would say that custom types are THE defining feature of Postgres, compared to other SQL implementations. regards, tom lane