Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hUEiv-0001wX-JG for pgsql-general@arkaria.postgresql.org; Fri, 24 May 2019 18:15:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hUEiu-0004GO-60 for pgsql-general@arkaria.postgresql.org; Fri, 24 May 2019 18:15:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hUEit-0004GG-SM for pgsql-general@lists.postgresql.org; Fri, 24 May 2019 18:15:19 +0000 Received: from pkw-spamtitan.pkwillis.com ([209.23.238.163]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hUEim-0008IL-Ch for pgsql-general@lists.postgresql.org; Fri, 24 May 2019 18:15:19 +0000 Received: from PKW-Exchange6.pkwillis.local (10.0.0.31) by PKW-Exchange5.pkwillis.local (10.0.0.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 24 May 2019 11:15:09 -0700 Received: from PKW-Exchange6.pkwillis.local ([fe80::85a2:4561:35f2:2ed5]) by PKW-Exchange6.pkwillis.local ([fe80::85a2:4561:35f2:2ed5%7]) with mapi id 15.01.1713.004; Fri, 24 May 2019 11:15:09 -0700 From: Ken Lacrosse To: "'pgsql-general@lists.postgresql.org'" Subject: Snippets? Thread-Topic: Snippets? Thread-Index: AdUSXF1m+dXww8/YTa6E7FjbCKvavg== Date: Fri, 24 May 2019 18:15:09 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.30.100.30] Content-Type: multipart/alternative; boundary="_000_f0bac938148e4f4f8fa69d65de427258pkwilliscom_" MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_f0bac938148e4f4f8fa69d65de427258pkwilliscom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Is there any way in postgresql to have a "snippet" of SQL code which you co= uld apply to all tables. Something you could add which would ensure that e= very table always has a Created, Changed and Deleted column for example. S= ort of like a C include I suppose. Of course if I'm building a DB schema b= y hand I could just copy and paste those columns but it still seems a bit t= oo, darn humans!, error prone. Ken LaCrosse Senior IT InfoSec and Infrastructure Monitoring Specialist I.T. | American Recovery Service & Skipbusters Phone: (800)398-6480 x3758 Email: KLacrosse@pkwillis.com www.pkwillis.com * Visibility is key. * Without visibility you can't see. What you can't see you can't measure. What you can't measure you can't planfully change. What you can't planfully change you can't manage. And if we can't manage then why are we here? NOTICE: The information contained in this transmission, including attachmen= ts, may contain confidential information that is privileged, confidential a= nd/or exempt from disclosure by applicable law. It is intended only for the= use of the person(s) or entity to which it is addressed. If the reader of = this transmission is not the intended recipient, the reader is hereby notif= ied that any review, use, dissemination, distribution or duplication of thi= s communication (including any reliance thereon) is strictly prohibited. If= you have received this transmission in error, please contact the sender by= reply email, then delete and destroy the material in its entirety, whether= in electronic or hard copy format. WE SPECIFICALLY DISCLAIM RESPONSIBILITY= FOR ANY UNAUTHORIZED USE OF THIS COMMUNICATION OR ANY ATTACHMENTS TO IT. T= hank you. --_000_f0bac938148e4f4f8fa69d65de427258pkwilliscom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Is there any way in postgresq= l to have a "snippet" of SQL code which you could apply to all ta= bles.  Something you could add which would ensure that every table always has a Created, Changed and Deleted column for example.  Sort o= f like a C include I suppose.  Of course if I’m building a DB sc= hema by hand I could just copy and paste those columns but it still seems a= bit too, darn humans!, error prone.

 

 

Ken LaCrosse

Senior IT InfoSec and Infrastructure Monitoring Spec= ialist

I.T. | American Recovery Service & Skipbusters

Phone: (800)398-6480 x3758

Email: KLa= crosse@pkwillis.com

www.pkwillis.co= m

 

* Visibility is key. *

Without visibility you can't see.

What you can't see you can't measure.

What you can't measure you can’t planfully cha= nge.

What you can’t planfully change you can't mana= ge.

And if we can’t manage then why are we here?

 

NOTICE: The information contained in this transmission, including attachmen= ts, may contain confidential information that is privileged, confidential a= nd/or exempt from disclosure by applicable law. It is intended only for the= use of the person(s) or entity to which it is addressed. If the reader of this transmission is not the in= tended recipient, the reader is hereby notified that any review, use, disse= mination, distribution or duplication of this communication (including any = reliance thereon) is strictly prohibited. If you have received this transmission in error, please contact the sender= by reply email, then delete and destroy the material in its entirety, whet= her in electronic or hard copy format. WE SPECIFICALLY DISCLAIM RESPONSIBIL= ITY FOR ANY UNAUTHORIZED USE OF THIS COMMUNICATION OR ANY ATTACHMENTS TO IT. Thank you. --_000_f0bac938148e4f4f8fa69d65de427258pkwilliscom_--