dbTalk Databases Forums  

[ADMIN] Can schemas be ordered regarding their creation time ?

mailing.database.pgsql-admin mailing.database.pgsql-admin


Discuss [ADMIN] Can schemas be ordered regarding their creation time ? in the mailing.database.pgsql-admin forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amador Alvarez
 
Posts: n/a

Default [ADMIN] Can schemas be ordered regarding their creation time ? - 06-05-2012 , 07:22 PM






Hi there,
I would like to know if it is possible to get the date when the
different schemas were created, as I want to write an script to dump
only the latest schemas, the latest month created schemas for instance.

Thanks in advance,
A.A.

--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [ADMIN] Can schemas be ordered regarding their creation time ? - 06-05-2012 , 07:43 PM






Amador Alvarez <aalvarez (AT) d2 (DOT) com> writes:
Quote:
I would like to know if it is possible to get the date when the
different schemas were created, as I want to write an script to dump
only the latest schemas, the latest month created schemas for instance.
No, sorry, Postgres does not track creation time of database objects.

regards, tom lane

--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
  #3  
Old   
hari.fuchs@gmail.com
 
Posts: n/a

Default Re: [ADMIN] Can schemas be ordered regarding their creation time ? - 06-06-2012 , 03:06 AM



Amador Alvarez <aalvarez (AT) d2 (DOT) com> writes:

Quote:
Hi there,
I would like to know if it is possible to get the date when the
different schemas were created, as I want to write an script to dump
only the latest schemas, the latest month created schemas for
instance.
You could attach the creation date to the schema name or use
"COMMENT ON SCHEMA x IS 'y'".


--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
  #4  
Old   
hari.fuchs@gmail.com
 
Posts: n/a

Default Re: [ADMIN] Can schemas be ordered regarding their creation time ? - 06-07-2012 , 02:47 AM



Amador Alvarez <aalvarez (AT) d2 (DOT) com> writes:

Quote:
Any idea on doing ("COMMENT ON SCHEMA x IS 'y'") as 'y' variable?
You could use PL/pgSQL's "EXECUTE" for that:

DO $$BEGIN
EXECUTE 'COMMENT ON SCHEMA myschema IS ''Created ' ||
current_timestamp || '''';
END$$;


--
Sent via pgsql-admin mailing list (pgsql-admin (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.