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 1hUEo9-0002D0-Mr for pgsql-general@arkaria.postgresql.org; Fri, 24 May 2019 18:20:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hUEo8-00087B-EI for pgsql-general@arkaria.postgresql.org; Fri, 24 May 2019 18:20:44 +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 1hUEo8-00081Y-1C for pgsql-general@lists.postgresql.org; Fri, 24 May 2019 18:20:44 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hUEo5-0008Sy-6P for pgsql-general@lists.postgresql.org; Fri, 24 May 2019 18:20:43 +0000 Received: by mail-ot1-x32a.google.com with SMTP id n14so9565369otk.2 for ; Fri, 24 May 2019 11:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=fOGi5erYL/i1hPqLICueCmhPoaAuSXH7ewdp8nNf6Rw=; b=AaAH4ZKgRWiz8U+oskxP5Ei01AjLBQgUyJl1y96rx7T9Z+rEzJIuIxcMGqLrM+LWv5 fneaRNmu7Dhx2slgxkrOQlT7+S2Q5ThZhMKaPYlIyMU4MnXUijZVrxxk3XtMCPolUmNV lrcVqXwyffcWFeJ2qfZItLVrGO2nAEK3Ryk5XwjtZIYStpgQ+cBVfFOELka0bwzsPhgd Xn2rT1gjBwfRCbuHfZX2R8/VNaOiqyqaqGGrzrQZkD/vSC8djFIPlQZXiJ/Sh1z6EQA9 Irr5VBdP+ql23OEavArnDLpnZxXlRSZ6T/M+hfepRR+JrdzguOiLijTjBtm5Mq/TcwGs p1zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=fOGi5erYL/i1hPqLICueCmhPoaAuSXH7ewdp8nNf6Rw=; b=i+gSZfOgTytfOof9W12AsXbCToSrVjltVugO6dC6xdb1hHd3T03w9RQNCnMx1UY/Wx xfrqsUxqUoWFmXKlG8H5c0deg4TXwDOmzrqODniGUa4aTnOnTnwA4lTaxGna8dSmpLPX TU4SkQOn21YuTPfKZxFYFJKY1mJa8tM7rkjWjEImnXbOTUkPl/ahHk5oZWwFqeoClvku REiNl+Wt8X0XpTg/FxBoWyyeBNdYtcYSoXdJe+UOpxLoySqpCkLTQMXpbCoRisr4X0iP iAaDhtuADBJ4Z7ORontwl4x7zt9pkCLyil5BCHFXbcCuktVH8ZXyteBBRDUcfQ7Xvwdu Rnnw== X-Gm-Message-State: APjAAAWMykhQK2kpm+vAu/zKWS751XgaKTSCnKtJ6pnwU6pnzDNoti3Y iSTlokUEPFW3dpt/j1KfPNEHeXiFmfjkJA== X-Google-Smtp-Source: APXvYqyL7uDVo01001Km/QAs3Tt94wjl7dNNV6CY9yl/3CVDmztsiULBisJ383sT/YAnvXt70Rg1XQ== X-Received: by 2002:a9d:2785:: with SMTP id c5mr57805565otb.301.1558722038736; Fri, 24 May 2019 11:20:38 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id 62sm1239586oid.35.2019.05.24.11.20.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 May 2019 11:20:37 -0700 (PDT) Subject: Re: Snippets? To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Fri, 24 May 2019 13:20:37 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------F749B540D5E99C6D1F039733" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------F749B540D5E99C6D1F039733 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 5/24/19 1:15 PM, Ken Lacrosse wrote: > > Is there any way in postgresql to have a "snippet" of SQL code which you > could apply to all tables.  Something you could add which would ensure > that every table always has a Created, Changed and Deleted column for > example.  Sort of like a C include I suppose.  Of course if I’m building a > DB schema by hand I could just copy and paste those columns but it still > seems a bit too, darn humans!, error prone. > Inheritance might be what you want. -- Angular momentum makes the world go 'round. --------------F749B540D5E99C6D1F039733 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 5/24/19 1:15 PM, Ken Lacrosse wrote:

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


Inheritance might be what you want.

--
Angular momentum makes the world go 'round.
--------------F749B540D5E99C6D1F039733--