Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id AC4CF194E782 for ; Wed, 6 Jun 2012 17:45:27 -0300 (ADT) Received: from mx2.d2.com ([66.251.81.121]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ScN6Z-0004DT-QA for pgsql-admin@postgresql.org; Wed, 06 Jun 2012 20:45:26 +0000 Received: from mxb.d2.com ([10.85.4.6]) by mx2.d2.com (8.13.8/8.13.8) with ESMTP id q56Lf9Hg005662 for ; Wed, 6 Jun 2012 14:41:23 -0700 X-ASG-Debug-ID: 1339015487-01d10a6c962073a60001-ysJW5H Received: from mail01.d2.com ([172.16.66.171]) by mxb.d2.com with ESMTP id JnaArWCiqnbuCuTj for ; Wed, 06 Jun 2012 13:44:47 -0700 (PDT) X-Barracuda-Envelope-From: aalvarez@d2.com Received: from exbew2k3-02.d2.com (exbew2k3-02 [10.78.2.16]) by mail01.d2.com (8.13.8/8.13.8/Debian-3) with ESMTP id q56Kiksd005387 for ; Wed, 6 Jun 2012 13:44:46 -0700 Received: from [10.126.2.220] ([10.126.2.220] RDNS failed) by exbew2k3-02.d2.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Jun 2012 13:44:46 -0700 Message-ID: <4FCFC13E.5040503@d2.com> Date: Wed, 06 Jun 2012 13:44:46 -0700 From: Amador Alvarez User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Can schemas be ordered regarding their creation time ? References: <4FCEA2DF.3010904@d2.com> <877gvkc1a6.fsf@hf.protecting.net> X-ASG-Orig-Subj: Re: [ADMIN] Can schemas be ordered regarding their creation time ? In-Reply-To: <877gvkc1a6.fsf@hf.protecting.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Jun 2012 20:44:46.0800 (UTC) FILETIME=[35A38500:01CD4425] X-Barracuda-Connect: UNKNOWN[172.16.66.171] X-Barracuda-Start-Time: 1339015487 X-Barracuda-URL: http://10.85.4.6:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at d2.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.99140 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: NO, score=-2.5 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RATWARE_GECKO_BUILD autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mx2.d2.com X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/18 X-Sequence-Number: 39609 Thanks hary and Matthias, It is a very good idea, however the schema names are meaningful and not allowed to be attached to a date. Regarding the comment solution ("COMMENT ON SCHEMA x IS 'y'"), it sounds great and I tried to run different examples without happy ending as 'y' must be a literal string. I ran commands like these : comment on schema users is select to_char(current_timestamp,'DD Mon YYYY'); comment on schema users is select quote_literal(to_char(current_timestamp,'DD Mon YYYY')); ..... and even simple concatenated strings : comment on schema users is 'a'||'b'; ERROR: syntax error at or near "||" LINE 1: comment on schema users is 'a'||'b'; ... and even with a function returning a text ... : ( Any idea on doing ("COMMENT ON SCHEMA x IS 'y'") as 'y' variable? Thanks again, I appreciate it a lot, A.A. I have been trying a lot of different options to do this : "COMMENT ON SCHEMA x IS 'y'". On 06/06/2012 01:06 AM, hari.fuchs@gmail.com wrote: > Amador Alvarez writes: > >> 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'". > >