Re: field defaults
От | Peter Eisentraut |
---|---|
Тема | Re: field defaults |
Дата | |
Msg-id | Pine.LNX.4.44.0303281449000.2204-100000@peter.localdomain обсуждение исходный текст |
Ответ на | field defaults (Peter Childs <blue.dragon@blueyonder.co.uk>) |
Список | pgsql-sql |
Peter Childs writes: > I need a method of getting the column defaults out of my database. > I would like to use them to fill in a screen so the user can then edit > them before they insert the record. > Looking at how psql does this it does not seam very easy. > I think a view of the relevent system table should help. Well, the default expressions are stored in the system table pg_attrdef, but note that they are expressions. Even if you could evaluate those expressions yourself the results won't be the same as letting the database evaluate them, because the data that the default expressions refer to might have changed between the time you've read them and the time you're inserting the data. If you insist on this user interface you described, maybe it's better to save your defaults somewhere else. -- Peter Eisentraut peter_e@gmx.net
В списке pgsql-sql по дате отправления: