PostgreSQL overrides legacy columns

Suppose I have an xmldoc relation that looks like this:

   Column     |            Type             | Modifiers                          
--------------+-----------------------------+-----------------
docid         | integer                     | not null  
create_date   | timestamp without time zone | not null 
type          | text                        | not null
xml           | xml                         | 

Now, let's say I create another table that simply inherits this table without any other columns. How can I say override 'xml' to be of type 'text'?

I am currently getting:

ERROR:  cannot alter inherited column "xml"

So how does overriding work in DB inheritance? [In particular, I am using PostgreSQL 8.3]

+3
source share
1 answer

From the exact guide :

If the list of column names of the new table contains a column name that is also inherited, the data type must also match the inherited column (s), and the column definitions are combined into one.

, xml text. " ?" , , (, ) , .

? ( AKA) .

+4

Source: https://habr.com/ru/post/1789645/


All Articles