473,406 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

timestamps

How would I specify a field that's to be updated to current_time
everytime the row is created/altered?

Is there some way to put this 'update' property into the table instead
of running some query to do it?
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
3 1027


--On Tuesday, May 25, 2004 20:52:22 -0400 Tom Allison
<ta******@tacocat.net> wrote:
How would I specify a field that's to be updated to current_time
everytime the row is created/altered?

Is there some way to put this 'update' property into the table instead of
running some query to do it? You are looking for a trigger.



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: le*@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAs+92rRNGhTxJvdYRAlFSAKCPnutipCDWNVJY3I2IYu btsdkshQCfVFKG
x84g0s4UguwUQ3/ti1tzBGQ=
=sVW0
-----END PGP SIGNATURE-----

Nov 23 '05 #2
Tom Allison <ta******@tacocat.net> writes:
How would I specify a field that's to be updated to current_time
everytime the row is created/altered?
Create a trigger. There are some good examples in the PL/pgSQL docs.
Is there some way to put this 'update' property into the table instead
of running some query to do it?


Triggers are the way to go in Postgres.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
Doug McNaught wrote:
Tom Allison <ta******@tacocat.net> writes:

How would I specify a field that's to be updated to current_time
everytime the row is created/altered?

Create a trigger. There are some good examples in the PL/pgSQL docs.

Is there some way to put this 'update' property into the table instead
of running some query to do it?

Triggers are the way to go in Postgres.

-Doug


Thanks for the pointer. That should be enough.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: lkrubner | last post by:
This might be an idiot question, but how do you group by timestamps by date? I mean, given a large number of timestamps, spanning many months, how do grab them and say how many are from each day?...
10
by: Craig Wahlmeier | last post by:
Am I the only one in the world that selects dates and timestamps with OLEDB? V8 of UDB has brought me a big problem. The PATCH2=24 setting no longer works the way it used to. The settings of...
5
by: Robert Schuldenfrei | last post by:
Dear NG, I have not heard from anyone about a good book that deals with the concurrency issue in SQL Server using C#. I have PROMISED Nick I would not use record locking and I have used an old...
2
by: Chumma Dede | last post by:
Hi, I need to code a DLL in .NET which logs the response times for our asp.net multi-tier application. The problem is we need to log the timestamps at multiple stages in a process lifecycle...
4
by: Craig G | last post by:
im not too sure how i should be storing the SQL2000 timestamps basically i return a dataset which is used to populate an editable grid. this dataset contains the timestamp. how should i be...
1
by: Erwin Van de Velde | last post by:
Hi, I'm building a central logging system for security applications as my master thesis, but I've run into some troubles: Different applications make database logs using different formats: -...
3
by: rAinDeEr | last post by:
Hi, Is there any performance issues related to having default timestamps in tables? I have a Data Model in which all the tables have created_tms and last_updated_tms which I have set default...
0
by: mikek | last post by:
Good Morning from Detroit, I am working on a project to Connect and manipulatee data in a SQLServer Data base, from a LINUX server using PERL. and SOAP We decided to use SOAP:Lite. (there are...
16
by: maruk2 | last post by:
I have some old data files with old timestamps, where timestmap=time(NULL), some of them date back to the year 1999. I want to my code to print the timestamps and each one to include...
6
by: xkenneth | last post by:
All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.