Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqPed-0002bP-79 for pgsql-general@arkaria.postgresql.org; Mon, 26 Feb 2018 20:45:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eqPec-0007Oz-1N for pgsql-general@arkaria.postgresql.org; Mon, 26 Feb 2018 20:45:46 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqPeb-0007Op-Jw for pgsql-general@lists.postgresql.org; Mon, 26 Feb 2018 20:45:45 +0000 Received: from mail-pl0-x231.google.com ([2607:f8b0:400e:c01::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eqPeW-0002uK-Cw for pgsql-general@postgresql.org; Mon, 26 Feb 2018 20:45:44 +0000 Received: by mail-pl0-x231.google.com with SMTP id s13so9972808plq.6 for ; Mon, 26 Feb 2018 12:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rxmg-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=U2iGlkaaLpU8r7uFx97ncEqyYmSRzz9CSiWIv/hZPlc=; b=ulxFXtr1MA4HmiTKV814w/HxBIBiSm+hQQ8TGOwD4egyQob0BUh9z0m058mLLjsjBn cODCIFjdeA0/5xj9tuwZl7mfYwMKgywwEvwIiwGJyzCXs9I6ZuYgLmU3grw7mC5Ke4iw Wmd4JXk2eMA1mGmWXYHtkeThXPRKguQaH0nCDgDf2mDZLo6uHX4nH8KipxJgc0DqYQVa 05197umaOuyUI1engSDqD/jmC/z6PQeiFkGgUqu4d+X5hZiO5u6SdUrOfnxlaZ4oGx8B x91KKYVgIxMvm2k3UmzTZ+DNv1KLIW2fgue2QcxMWA5gQXgiicYcML2PHuKD8qcldo3f EkbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=U2iGlkaaLpU8r7uFx97ncEqyYmSRzz9CSiWIv/hZPlc=; b=lRkYRnPVZO3cDZYpnb3c0ii4nQAI0tMmgFkjVZ7/5CvGUS4zC9xuCrBXaA9U/s4xKn NcAH+YeIezZqvyL0+6flNebshKcZJwwi8B6qSu7Mp3QOjMO0vhLm9H/mbWwcqXzg8hos 6+haTSfk9QUnTpC+bN58u++ybJbjRP0E/v/QGd7Hn64iyk+DXLiPOYSBHGrGWs2RmfAs 4E1FTtSBu7SqJ+IxtpCvPebHhIRdiyiirluUyPBWXq3f08mKLLCfVAAlf5/Q3G+ihY9R r77aPhV0zPVpWtzWq0npIs7UBIGv6O2v1CnEzsr7fMCIZZt3bxFtLCz5ido0DcSiHUnS r3cQ== X-Gm-Message-State: APf1xPDQIpsJoD69w3Olfp638jl/6w9QmkOfnkJ5PGRzjreixps9fOEv WeAH+0oQWXGElrs962WfxGhOGBEFImQ= X-Google-Smtp-Source: AH8x224wIuvniocUzCkSwtCRaX+Y+4Z0zjBwKx1So9XH5PSJLwoHeF6GMmxIWlTozW2Z9k/7qKCHAw== X-Received: by 2002:a17:902:ba95:: with SMTP id k21-v6mr12067240pls.111.1519677937478; Mon, 26 Feb 2018 12:45:37 -0800 (PST) Received: from [192.168.222.7] (ec2-34-216-35-238.us-west-2.compute.amazonaws.com. [34.216.35.238]) by smtp.gmail.com with ESMTPSA id z15sm15064955pgr.68.2018.02.26.12.45.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 12:45:36 -0800 (PST) From: geoff hoffman Content-Type: multipart/alternative; boundary="Apple-Mail=_6AA095BC-B096-4624-B1F4-4E6F257C07B3" Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Creating complex track changes database - challenge! Date: Mon, 26 Feb 2018 13:45:35 -0700 References: To: PG-General Mailing List In-Reply-To: Message-Id: <2F51CE74-A348-41DC-A673-7A39D4DE86BE@rxmg.com> X-Mailer: Apple Mail (2.3445.5.20) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_6AA095BC-B096-4624-B1F4-4E6F257C07B3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I would personally do that separately: write a bash script & cron job = that does a schema dump every hour, and (if there are any changes) = commits any changes to your schema repository; then you can use Github = or Bitbucket web hooks to do stuff with the changeset when it=E2=80=99s = pushed.=20 = https://stackoverflow.com/questions/3878624/how-do-i-programmatically-dete= rmine-if-there-are-uncommitted-changes = = https://stackoverflow.com/questions/24772591/check-if-git-has-changes-prog= rammatically = =20 > On Feb 26, 2018, at 9:36 AM, =C5=81ukasz Jarych = wrote: >=20 > Thank you geoff!=20 >=20 > I think that i will test http://www.liquibase.org/ = this one.=20 >=20 > what about setting up trigger to metadata (structural table) to find = if column was added for example?=20 >=20 > Best, > Jacek >=20 > 2018-02-26 16:43 GMT+01:00 geoff hoffman >: >=20 >=20 > There=E2=80=99s https://flywaydb.org/ > and http://www.liquibase.org/ >=20 > More: https://dbmstools.com/version-control-tools = =20 >=20 > Also, if you know PHP, Laravel database migrations have worked great = for us! > https://laravel.com/docs/5.6/migrations = >=20 >=20 >=20 >> On Feb 26, 2018, at 3:44 AM, =C5=81ukasz Jarych > wrote: >>=20 >> i would like to ask you for help with track changes to my database.=20= >> I am new to PosgtreeSQL but i have to learn it quickly because of my = boss.=20 >>=20 >> I have to: >>=20 >> 1. Keep all changes within table including: >> -adding rows >> -deleting >> -editing >>=20 >> 2. Save table with specific state and recover specific state (so go = back to previous table versions) including comparing tables. >>=20 >> 3. Track all DLL and DML changes with possibility to ho back to = previous version.=20 >>=20 >=20 >=20 --Apple-Mail=_6AA095BC-B096-4624-B1F4-4E6F257C07B3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
I would personally do that separately: write a bash script = & cron job that does a schema dump every hour, and (if there are any = changes) commits any changes to your schema repository; then you can use = Github or Bitbucket web hooks to do stuff with the changeset when it=E2=80= =99s pushed. 




On Feb 26, 2018, at 9:36 AM, = =C5=81ukasz Jarych <jaryszek@gmail.com> wrote:

Thank you geoff! 

I think that i will test http://www.liquibase.org/ this one. 

what about setting up = trigger to metadata (structural table) to find if column was added for = example? 

Best,
Jacek

2018-02-26= 16:43 GMT+01:00 geoff hoffman <geoff@rxmg.com>:

There=E2=80=99s https://flywaydb.org/


Also, if you know PHP, Laravel database = migrations have worked great for us!



On Feb 26, 2018, at 3:44 AM, =C5=81ukasz Jarych <jaryszek@gmail.com> wrote:

i would like to ask you for help with track changes to my = database. 
I am new to PosgtreeSQL but i have to learn it quickly = because of my boss. 

I have to:

1. Keep all changes within table including:
-adding rows
-deleting
-editing

2. Save table with specific state and recover specific state = (so go back to previous table versions) including comparing = tables.

3. Track all DLL and DML changes with possibility to ho back = to previous version. 




= --Apple-Mail=_6AA095BC-B096-4624-B1F4-4E6F257C07B3--