Search Postgresql Archives

default column value using a function, trigger, or whatever

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]


---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?

http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux