Get last modified date of table in postgresql Announcing the arrival of Valued Associate #679:...

How to write the following sign?

Do wooden building fires get hotter than 600°C?

How does the math work when buying airline miles?

How to install press fit bottom bracket into new frame

A term for a woman complaining about things/begging in a cute/childish way

Should I follow up with an employee I believe overracted to a mistake I made?

What would you call this weird metallic apparatus that allows you to lift people?

Localisation of Category

What is the difference between globalisation and imperialism?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

Disembodied hand growing fangs

Should I use a zero-interest credit card for a large one-time purchase?

Significance of Cersei's obsession with elephants?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

What was the first language to use conditional keywords?

What is the font for "b" letter?

Effects on objects due to a brief relocation of massive amounts of mass

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

How does light 'choose' between wave and particle behaviour?

Selecting user stories during sprint planning

How were pictures turned from film to a big picture in a picture frame before digital scanning?

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

An adverb for when you're not exaggerating

Can the Great Weapon Master feat's "Power Attack" apply to attacks from the Spiritual Weapon spell?



Get last modified date of table in postgresql



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Getting last modification date of a PostgreSQL database tableSQL query to sum a column prior to date and show all entries after that dateHow can I get my server's uptime?PostgreSQL: changing data directory location (sshfs)RHEL Postgresql 9.4 and PostGISUpgrade PostgreSQL 9.4 to 9.5 : LC_ALL unsetHow to get particular object from jsonb array in PostgreSQL?Database design. And get last modified time with each column in PostgreSQLPostgreSQL select count with dynamic date rangeHow to get aggregate data from a dynamic number of related rows in adjacent table





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I want know the last modified date of table in postgresql. In SQL Server can get using



SELECT modify_date FROM sys.objects 


How to get same thing in Postgres? I am using Postgres 9.4










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    That's not possible. Postgres does not maintain that information

    – a_horse_with_no_name
    Mar 3 '18 at 10:35






  • 1





    no other way to get information then

    – veena hosur
    Mar 3 '18 at 10:37


















0















I want know the last modified date of table in postgresql. In SQL Server can get using



SELECT modify_date FROM sys.objects 


How to get same thing in Postgres? I am using Postgres 9.4










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    That's not possible. Postgres does not maintain that information

    – a_horse_with_no_name
    Mar 3 '18 at 10:35






  • 1





    no other way to get information then

    – veena hosur
    Mar 3 '18 at 10:37














0












0








0








I want know the last modified date of table in postgresql. In SQL Server can get using



SELECT modify_date FROM sys.objects 


How to get same thing in Postgres? I am using Postgres 9.4










share|improve this question
















I want know the last modified date of table in postgresql. In SQL Server can get using



SELECT modify_date FROM sys.objects 


How to get same thing in Postgres? I am using Postgres 9.4







postgresql postgresql-9.4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 3 '18 at 10:35









a_horse_with_no_name

41.8k780117




41.8k780117










asked Mar 3 '18 at 9:30









veena hosurveena hosur

15




15





bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    That's not possible. Postgres does not maintain that information

    – a_horse_with_no_name
    Mar 3 '18 at 10:35






  • 1





    no other way to get information then

    – veena hosur
    Mar 3 '18 at 10:37














  • 1





    That's not possible. Postgres does not maintain that information

    – a_horse_with_no_name
    Mar 3 '18 at 10:35






  • 1





    no other way to get information then

    – veena hosur
    Mar 3 '18 at 10:37








1




1





That's not possible. Postgres does not maintain that information

– a_horse_with_no_name
Mar 3 '18 at 10:35





That's not possible. Postgres does not maintain that information

– a_horse_with_no_name
Mar 3 '18 at 10:35




1




1





no other way to get information then

– veena hosur
Mar 3 '18 at 10:37





no other way to get information then

– veena hosur
Mar 3 '18 at 10:37










1 Answer
1






active

oldest

votes


















0














If the file system stores file modification time (mtime), I believe you can use



SELECT pg_relation_filepath('schema.table');


To find the path to the table's heap. From there you can look up the file modification time (mtime). This has a lot of drawbacks,




  1. It may be obscured by WAL, data could be written to the write-ahead log pending a checkpoint. In such a case, nothing has even tried to write it to disk.

  2. The FS may be journaling the data itself.

  3. The data may be in the write cache of the operating system.


Shy of that you may need to write your own mtime-abilities on the rows being updated/inserted, or the table (by creating a meta-table with its own rows).



CREATE TABLE foo (
id int,
mtime timestamp with time zone DEFAULT now()
);
INSERT INTO foo(id) VALUES (1);


or, for a meta table



CREATE TABLE foo (
id serial,
fqn_table text,
mtime timestamp with time zone DEFAULT now()
);





share|improve this answer
























  • i cant create mtime. Its not in our schema

    – veena hosur
    Mar 5 '18 at 6:07












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f199290%2fget-last-modified-date-of-table-in-postgresql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














If the file system stores file modification time (mtime), I believe you can use



SELECT pg_relation_filepath('schema.table');


To find the path to the table's heap. From there you can look up the file modification time (mtime). This has a lot of drawbacks,




  1. It may be obscured by WAL, data could be written to the write-ahead log pending a checkpoint. In such a case, nothing has even tried to write it to disk.

  2. The FS may be journaling the data itself.

  3. The data may be in the write cache of the operating system.


Shy of that you may need to write your own mtime-abilities on the rows being updated/inserted, or the table (by creating a meta-table with its own rows).



CREATE TABLE foo (
id int,
mtime timestamp with time zone DEFAULT now()
);
INSERT INTO foo(id) VALUES (1);


or, for a meta table



CREATE TABLE foo (
id serial,
fqn_table text,
mtime timestamp with time zone DEFAULT now()
);





share|improve this answer
























  • i cant create mtime. Its not in our schema

    – veena hosur
    Mar 5 '18 at 6:07
















0














If the file system stores file modification time (mtime), I believe you can use



SELECT pg_relation_filepath('schema.table');


To find the path to the table's heap. From there you can look up the file modification time (mtime). This has a lot of drawbacks,




  1. It may be obscured by WAL, data could be written to the write-ahead log pending a checkpoint. In such a case, nothing has even tried to write it to disk.

  2. The FS may be journaling the data itself.

  3. The data may be in the write cache of the operating system.


Shy of that you may need to write your own mtime-abilities on the rows being updated/inserted, or the table (by creating a meta-table with its own rows).



CREATE TABLE foo (
id int,
mtime timestamp with time zone DEFAULT now()
);
INSERT INTO foo(id) VALUES (1);


or, for a meta table



CREATE TABLE foo (
id serial,
fqn_table text,
mtime timestamp with time zone DEFAULT now()
);





share|improve this answer
























  • i cant create mtime. Its not in our schema

    – veena hosur
    Mar 5 '18 at 6:07














0












0








0







If the file system stores file modification time (mtime), I believe you can use



SELECT pg_relation_filepath('schema.table');


To find the path to the table's heap. From there you can look up the file modification time (mtime). This has a lot of drawbacks,




  1. It may be obscured by WAL, data could be written to the write-ahead log pending a checkpoint. In such a case, nothing has even tried to write it to disk.

  2. The FS may be journaling the data itself.

  3. The data may be in the write cache of the operating system.


Shy of that you may need to write your own mtime-abilities on the rows being updated/inserted, or the table (by creating a meta-table with its own rows).



CREATE TABLE foo (
id int,
mtime timestamp with time zone DEFAULT now()
);
INSERT INTO foo(id) VALUES (1);


or, for a meta table



CREATE TABLE foo (
id serial,
fqn_table text,
mtime timestamp with time zone DEFAULT now()
);





share|improve this answer













If the file system stores file modification time (mtime), I believe you can use



SELECT pg_relation_filepath('schema.table');


To find the path to the table's heap. From there you can look up the file modification time (mtime). This has a lot of drawbacks,




  1. It may be obscured by WAL, data could be written to the write-ahead log pending a checkpoint. In such a case, nothing has even tried to write it to disk.

  2. The FS may be journaling the data itself.

  3. The data may be in the write cache of the operating system.


Shy of that you may need to write your own mtime-abilities on the rows being updated/inserted, or the table (by creating a meta-table with its own rows).



CREATE TABLE foo (
id int,
mtime timestamp with time zone DEFAULT now()
);
INSERT INTO foo(id) VALUES (1);


or, for a meta table



CREATE TABLE foo (
id serial,
fqn_table text,
mtime timestamp with time zone DEFAULT now()
);






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 3 '18 at 19:59









Evan CarrollEvan Carroll

33.8k1079235




33.8k1079235













  • i cant create mtime. Its not in our schema

    – veena hosur
    Mar 5 '18 at 6:07



















  • i cant create mtime. Its not in our schema

    – veena hosur
    Mar 5 '18 at 6:07

















i cant create mtime. Its not in our schema

– veena hosur
Mar 5 '18 at 6:07





i cant create mtime. Its not in our schema

– veena hosur
Mar 5 '18 at 6:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Database Administrators Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f199290%2fget-last-modified-date-of-table-in-postgresql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...