Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Anssi Kääriäinen
On 01/17/2011 07:58 PM, Kääriäinen Anssi wrote: The issue I saw was this: assume you have an extension foo, containing one function, test(). CREATE EXTENSION foo; DROP FUNCTION test(); -- restricted due to dependency ALTER FUNCTION test() RENAME TO test2; DROP FUNCTION test2(); -- not

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Anssi Kääriäinen
On 01/17/2011 06:53 PM, Dimitri Fontaine wrote: Usability review: The patch implements a way to create extensions. While the patch is labeled extensions support for pg_dump, it actually implements more. It implements a new way to package and install extension, and changes contrib extensions to

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Anssi Kääriäinen
On 01/18/2011 11:42 AM, Dimitri Fontaine wrote: I've fixed the case by having the code remember the function's extension if any, and restore it along with the other dependencies. The only question here is should CREATE OR REPLACE be allowed. I just realized this could present a new problem. If

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Dimitri Fontaine
Anssi Kääriäinen anssi.kaariai...@thl.fi writes: Is this supposed to be used mainly by contrib and PGXN extensions? When I saw the documentation, I immediately thought that this is a nice way to package my application's stored procedures. If this is not one of the intended usages, it should be

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Anssi Kääriäinen
On 01/18/2011 12:11 PM, Anssi Kääriäinen wrote: The only question here is should CREATE OR REPLACE be allowed. I just realized this could present a new problem. If I am not mistaken, when loading from dump, you suddenly get the extension's version back, not the one you defined in CREATE OR

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Dimitri Fontaine
Anssi Kääriäinen anssi.kaariai...@thl.fi writes: The only question here is should CREATE OR REPLACE be allowed. I just Yes. Think ALTER EXTENSION UPGRADE, the next patch in the series (already proposed for this CF too). realized this could present a new problem. If I am not mistaken, when

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Dimitri Fontaine
Anssi Kääriäinen anssi.kaariai...@thl.fi writes: Ok, verified at least for CREATE OR REPLACE, ALTER FUNCTION RENAME and ALTER FUNCTION SET search_path. You will get the extensions version back when restoring from plain sql dump, not the CORed function, rename is lost and same for search_path.

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Anssi Kääriäinen
On 01/18/2011 01:03 PM, Dimitri Fontaine wrote: I'd appreciate a list of yet-to-fix items. What I have is the search_path issue where CREATE EXTENSION foo; can leave it changed for the current session, I intend to fix that later today. Other than that, I have no further already agreed on code

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Alvaro Herrera
Excerpts from Dimitri Fontaine's message of mar ene 18 07:01:55 -0300 2011: Anssi Kääriäinen anssi.kaariai...@thl.fi writes: It used to work this way with \i, obviously. Should the extension patch care about that and how? Do we want to RESET search_path or to manually manage it like we

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-18 Thread Dimitri Fontaine
Anssi Kääriäinen anssi.kaariai...@thl.fi writes: On 01/18/2011 01:03 PM, Dimitri Fontaine wrote: I'd appreciate a list of yet-to-fix items. What I have is the search_path issue where CREATE EXTENSION foo; can leave it changed for the current session, I intend to fix that later today. After

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-17 Thread Alvaro Herrera
Excerpts from Anssi Kääriäinen's message of lun ene 17 12:41:25 -0300 2011: While it is not possible to drop functions in extensions, it is possible to rename a function, and also to CREATE OR REPLACE a function in an extension. After renaming or CORing a function, it is possible to drop

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-17 Thread Robert Haas
On Mon, Jan 17, 2011 at 10:41 AM, Anssi Kääriäinen anssi.kaariai...@thl.fi wrote: I haven't had time to review the pg_dump part of the patch yet, will do that next (tomorrow). I hope it is OK to post a partial review... It is, and this is a very good and detailed review! -- Robert Haas

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-17 Thread Dimitri Fontaine
Hi, Thanks for your review! Anssi Kääriäinen anssi.kaariai...@thl.fi writes: Does the patch apply cleanly? No: That was some bitrot, has been fixed, thanks you for working from the git repository meanwhile. pg_dump.c:3748: warning: too many arguments for format Fixed in v25 already sent

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-17 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Anssi Kääriäinen's message of lun ene 17 12:41:25 -0300 2011: While it is not possible to drop functions in extensions, it is possible to rename a function, and also to CREATE OR REPLACE a function in an extension. After

Re: [HACKERS] REVIEW: Extensions support for pg_dump

2011-01-17 Thread Kääriäinen Anssi
Well I'm not seeing that here I am not at work at the moment and I don't have the possibility to compile PostgreSQL on this computer, so the example here is from memory. The issue I saw was this: assume you have an extension foo, containing one function, test(). CREATE EXTENSION foo; DROP