Re: Can pg_restore produce create or replace commands - Mailing list pgsql-general

From Berend Tober
Subject Re: Can pg_restore produce create or replace commands
Date
Msg-id 54BB13E8.8090502@computer.org
Whole thread Raw
In response to Re: Can pg_restore produce create or replace commands  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Can pg_restore produce create or replace commands  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Thomas Kellerer wrote:
> Berend Tober wrote on 17.01.2015 19:05:
>> I often work with the output of pg_restore from a custom format dump
>> file. ...
>>
>> Most often, I'm refactoring functions and so don't really want to
>> drop the function but rather want to do a "create or replace
>> function" ...
>>
>
> To me this sounds as if you are doing it the wrong way round.


Possibly. But if the revision control system and the production data
base disagree, then which one do you believe?


>
> To manage (refactor) your functions, you should have the current code
> stored
> in a version control system, update the code there an then apply it to the
> target database.
>
> Extracting the code from the database in order to do refactoring is
> like disassembling a program each time you want to apply a bugfix.
>
> The code in the vcs would then contain the necessary "create or replace"
> (btw you still need to drop the function if you change the parameters)
>



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Can pg_restore produce create or replace commands
Next
From: Michael Paquier
Date:
Subject: Re: WAL supported extension