default column value using a function, trigger, or whatever

Поиск
Список
Период
Сортировка
От Roderick A. Anderson
Тема default column value using a function, trigger, or whatever
Дата
Msg-id 4277FBBE.10103@tsmg.us
обсуждение исходный текст
Ответы Re: default column value using a function, trigger, or  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список pgsql-general
I am trying to come up with a method to have a default value for a
column based on a function and other columns.  I'm hoping ( well not too
much ) that what I figure out here will apply to MS SQL Server as I am
stuck using it unless I can prove there ain't no way it's going to
happen.  ( Now that the embarrassment of being stuck using SQL Server is
out of the way. )

I'd like to populate a column with the md5 of ColA || ':' || ColB || ':'
  || ColC.  A search of the archives ( with the terms I was using )
didn't turn up anything useful.

Would this be a function or a trigger?

Actually I can probably find examples in the two PostgreSQL books (
Bruce's and the one from Command Prompt ) I have when I get home tonight
but I couldn't in the docs.  There used to be a PostgreSQL Cookbook but
it can't find it -- even doing the Google thing.


Thought, ideas, pointers are welcome.
Rod
--


---
[This E-mail scanned for viruses by Declude Virus]


В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: plpythonu and dollar quoting
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: default column value using a function, trigger, or