"postgres row expiration" Code Answer's
You're definitely familiar with the best coding language SQL that developers use to develop their projects and they get all their queries like "postgres row expiration" answered properly. Developers are finding an appropriate answer about postgres row expiration related to the SQL coding language. By visiting this online portal developers get answers concerning SQL codes question like postgres row expiration. Enter your desired code related query in the search bar and get every piece of information about SQL code related question on postgres row expiration.
postgres row expiration
CREATE TABLE expire_table (
timestamp timestamp NOT NULL DEFAULT NOW(),
name TEXT NOT NULL
);
INSERT INTO expire_table (name) VALUES ('a');
INSERT INTO expire_table (name) VALUES ('b');
INSERT INTO expire_table (name) VALUES ('c');
select * from expire_table;
timestamp | name
----------------------------+------
2014-09-26 15:33:43.243356 | a
2014-09-26 15:33:45.222202 | b
2014-09-26 15:33:47.347131 | c
(3 rows)
CREATE FUNCTION expire_table_delete_old_rows() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
DELETE FROM expire_table WHERE timestamp < NOW() - INTERVAL '1 minute';
RETURN NEW;
END;
$$;
CREATE TRIGGER expire_table_delete_old_rows_trigger
AFTER INSERT ON expire_table
EXECUTE PROCEDURE expire_table_delete_old_rows();
INSERT INTO expire_table (name) VALUES ('d');
select * from expire_table;
timestamp | name
----------------------------+------
2014-09-26 15:36:56.132596 | d
(1 row)
Source: stackoverflow.com
All those coders who are working on the SQL based application and are stuck on postgres row expiration can get a collection of related answers to their query. Programmers need to enter their query on postgres row expiration related to SQL code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about postgres row expiration for the programmers working on SQL code while coding their module. Coders are also allowed to rectify already present answers of postgres row expiration while working on the SQL language code. Developers can add up suggestions if they deem fit any other answer relating to "postgres row expiration". Visit this developer's friendly online web community, CodeProZone, and get your queries like postgres row expiration resolved professionally and stay updated to the latest SQL updates.