Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlifI-0005ia-GJ for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Aug 2017 21:30:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlifH-0003nV-In for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Aug 2017 21:30:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dliaW-0002Pj-Fe for pgsql-bugs@postgresql.org; Sat, 26 Aug 2017 21:25:52 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dliaO-0008Ag-6b for pgsql-bugs@postgresql.org; Sat, 26 Aug 2017 21:25:50 +0000 Received: by mail-wm0-x232.google.com with SMTP id w3so4725430wmf.0 for ; Sat, 26 Aug 2017 14:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:cc:from:subject:date:importance :in-reply-to:references; bh=+BOox2cBJWbyPVlJKu5mIdhK/lFCdqWUq0eWGbtjb94=; b=rtZlPQw76Me3eaG60Otrq8jgdARumZ2GUJf43ZCkLjVN+S9ynlCBY8kyvyGBtyXd9t QMkwYgZFe4MN9PrFwpjWw6LfuxOVxe1JuZqPe0wfgCRjw+C7X8QVHy9pwkSVqcDSHnKk JPLshy9S88icc8rFIYLIajhjvYiDq5rdopRTXXUz+b7eILRCN1GHyuvm2DVqi8ggWjUH 3Yy+YnDoAIckCTXmrfYJkrzbnwwCnzWlFIiKPlt2RhjCvHYimULYqxRecqw5vkEw7PS6 76Scx3NPqNU1L4b3PPUe2/Xvej4/C98HD9HRCZ+d10rxGJcKWHsahQ9qZTPa5c8C6dOV IZ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:cc:from:subject:date :importance:in-reply-to:references; bh=+BOox2cBJWbyPVlJKu5mIdhK/lFCdqWUq0eWGbtjb94=; b=SSdX69IWmfpYUcclgZ5D51+ZMSMOpeg0v2XXvyPm+ADzOSA0oafCm3sKTGzX5hPB/g H1dp/CXgHWFdq6fvllr30lEYZ/l2y7FqACpUTQOR2gaDIgRD9YF3REg7r/OnYAnwDAX0 z0MXpfWorNsomsSNy4Lw3Mz87RXLKnDWeNI/4ttIAceIwiCTCXxj8BwpKYFm7pUpELxM 8USHzIwpXWaKnqAGiet45VeTRiVWYYHW69BmKq51Br+ri4Xws4LVVLTM+d/Y4wY2WKlT Pk6IHwvH1/3t5DCjczZX6PbPNW2IkP8ysiU/5pnlWIgYskrIDb+Q5fnDAHv6Y9vwyCuL SdJg== X-Gm-Message-State: AHYfb5hVJKVfSxo46z8+EC8NHBHyEQgKTmWm06eywCTPWygcwecpK9nX Q2heIzxo7JRUW/6Di40= X-Received: by 10.28.207.143 with SMTP id f137mr1415594wmg.94.1503782741599; Sat, 26 Aug 2017 14:25:41 -0700 (PDT) Received: from ?IPv6:2a01:e35:8b6d:7580:cc71:1d62:35a5:faad? ([2a01:e35:8b6d:7580:cc71:1d62:35a5:faad]) by smtp.gmail.com with ESMTPSA id z66sm3853976wme.34.2017.08.26.14.25.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Aug 2017 14:25:40 -0700 (PDT) Message-ID: <59a1e754.45b01c0a.8eb03.66cc@mx.google.com> MIME-Version: 1.0 To: Tom Lane Cc: "pgsql-bugs@postgresql.org" From: =?utf-8?Q?C=C3=A9dric_Prin-Derre?= Subject: Re: issue with C functions using pg_dump Date: Sat, 26 Aug 2017 23:25:39 +0200 Importance: normal X-Priority: 3 In-Reply-To: <7244.1503776197@sss.pgh.pa.us> References: <7244.1503776197@sss.pgh.pa.us> Content-Type: multipart/mixed; boundary="_233E7D4D-F7D3-48EE-AE5A-323338508068_" X-Antivirus: Avast (VPS 170826-0, 26/08/2017), Outbound message X-Antivirus-Status: Clean List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --_233E7D4D-F7D3-48EE-AE5A-323338508068_ Content-Type: multipart/alternative; boundary="_A784872F-BBD7-4D7B-81C4-129E6F890555_" --_A784872F-BBD7-4D7B-81C4-129E6F890555_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hello Tom, thanks for your quick answer, i was hoping to just get the create function code but i do not. Here s a sample of code not generated=C2=A0: CREATE OR REPLACE FUNCTION public.uuid_nil() RETURNS uuid AS '$libdir/uuid-ossp', 'uuid_nil' LANGUAGE c IMMUTABLE STRICT COST 1; ALTER FUNCTION public.uuid_nil() OWNER TO postgres; Here=E2=80=99s also the sql file generated with my command (pg_dump --dbname=3Dpostgresql://postgres:xxx@127.0.0.1:5432/Adventureworks --no-owner --format=3Dplain --schema=3Dpublic --file=3D"D:\public.sql") Regards, Provenance=C2=A0: Courrier pour Windows 10 De=C2=A0: Tom Lane Envoy=C3=A9 le=C2=A0:samedi 26 ao=C3=BBt 2017 21:36 =C3=80=C2=A0: C=C3=A9dric Prin-Derre Cc=C2=A0: pgsql-bugs@postgresql.org Objet=C2=A0:Re: [BUGS] issue with C functions using pg_dump =3D?UTF-8?B?Q8OpZHJpYyBQcmluLURlcnJl?=3D writes: > i am am doing some test using the Adventureworks sample database (availab= le > on postgresql wiki) and i have noticed an issue with pgdump > pg_dump --dbname=3Dpostgresql://postgres:xxx@127.0.0.1:5432/Adventureworks > --no-owner --format=3Dplain --schema=3Dpublic --file=3D"D:\public.sql" > the generated sql file does not contain the code of the LANGUAGE c > functions stored in this schema If you're expecting it to contain the C source code, you're mistaken. It should just be reconstructing the CREATE FUNCTION commands. Typical output for a C-language function might be something like CREATE FUNCTION int44in(cstring) RETURNS city_budget LANGUAGE c IMMUTABLE STRICT AS '$libdir/regress.so', 'int44in'; regards, tom lane --- L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=A9 v=C3= =A9rifi=C3=A9e par le logiciel antivirus Avast. https://www.avast.com/antivirus --_A784872F-BBD7-4D7B-81C4-129E6F890555_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Hello Tom, thanks for your quick answe= r,

 

i was = hoping to just =C2=A0get the create function code but i do not.

 

 

Here s a sample of code not generated :

 

CREATE OR REPLACE= FUNCTION public.uuid_nil()

=C2=A0 RETURNS uuid AS<= /p>

'$libdir/uuid-ossp', 'uuid_nil'

=C2=A0 LANGUAGE c IMMUTABLE STRICT

=C2=A0 COST= 1;

ALTER FUNCTION public.uuid_nil()

=C2=A0 OWNER TO postgres;

 

Here=E2=80=99s also the sql file generated with = my command

(pg_dump --dbname=3Dpostgresql://postgre= s:xxx@127.0.0.1:5432/Adventureworks

--no= -owner --format=3Dplain --schema=3Dpublic=C2=A0 --file=3D"D:\public.sq= l")

 

=  

Regards,

=  

Provenance : Courrier pour Windows 10<= /p>

 

De : = Tom Lane
Envoy=C3=A9 le&= nbsp;:samedi 26 ao=C3=BBt 2017 21:36
=C3=80 : C=C3=A9dric Prin-Derre
Cc : = pgsql-bugs@postgresql.org<= br>Objet :Re: [BUGS] issue with C functions using pg_dump

 

=3D?UTF-= 8?B?Q8OpZHJpYyBQcmluLURlcnJl?=3D <prinderr@gmail.com> writes:

> i am am doing some test using the Adventureworks samp= le database (available

> on postgresql wiki) and= i have noticed an issue with pgdump

> pg_dump -= -dbname=3Dpostgresql://postgres:xxx@127.0.0.1:5432/Adventureworks

> --no-owner --format=3Dplain --schema=3Dpublic=C2=A0 --f= ile=3D"D:\public.sql"

> the generated = sql file does not contain the code of the LANGUAGE c

> functions stored in this schema

 <= /o:p>

If you're expecting it to contain the C sourc= e code, you're mistaken.

It should just be reconstr= ucting the CREATE FUNCTION commands.

Typical output= for a C-language function might be something like

=  

CREATE FUNCTION int44in(cstring) = RETURNS city_budget

=C2=A0=C2=A0=C2=A0 LANGUAGE c I= MMUTABLE STRICT

=C2=A0=C2=A0=C2=A0 AS '$libdir/regr= ess.so', 'int44in';

 

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regards,= tom lane

 


3D"" Garant= i sans virus. www.avast.com
=
= --_A784872F-BBD7-4D7B-81C4-129E6F890555_-- --_233E7D4D-F7D3-48EE-AE5A-323338508068_ Content-Type: application/octet-stream; name="public.sql" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="public.sql" LS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wCi0tCgotLSBEdW1wZWQg ZnJvbSBkYXRhYmFzZSB2ZXJzaW9uIDkuNi4xCi0tIER1bXBlZCBieSBwZ19k dW1wIHZlcnNpb24gOS42LjEKClNFVCBzdGF0ZW1lbnRfdGltZW91dCA9IDA7 ClNFVCBsb2NrX3RpbWVvdXQgPSAwOwpTRVQgaWRsZV9pbl90cmFuc2FjdGlv bl9zZXNzaW9uX3RpbWVvdXQgPSAwOwpTRVQgY2xpZW50X2VuY29kaW5nID0g J1VURjgnOwpTRVQgc3RhbmRhcmRfY29uZm9ybWluZ19zdHJpbmdzID0gb247 ClNFVCBjaGVja19mdW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ogT3Jk ZXJOdW1iZXI7IFR5cGU6IERPTUFJTjsgU2NoZW1hOiBwdWJsaWM7IE93bmVy OiBwb3N0Z3JlcwotLQoKQ1JFQVRFIERPTUFJTiAiT3JkZXJOdW1iZXIiIEFT IGNoYXJhY3RlciB2YXJ5aW5nKDI1KTsKCgpBTFRFUiBET01BSU4gIk9yZGVy TnVtYmVyIiBPV05FUiBUTyBwb3N0Z3JlczsKCi0tCi0tIE5hbWU6IFBob25l OyBUeXBlOiBET01BSU47IFNjaGVtYTogcHVibGljOyBPd25lcjogcG9zdGdy ZXMKLS0KCkNSRUFURSBET01BSU4gIlBob25lIiBBUyBjaGFyYWN0ZXIgdmFy eWluZygyNSk7CgoKQUxURVIgRE9NQUlOICJQaG9uZSIgT1dORVIgVE8gcG9z dGdyZXM7CgotLQotLSBOYW1lOiBhZGQoaW50ZWdlciwgaW50ZWdlcik7IFR5 cGU6IEZVTkNUSU9OOyBTY2hlbWE6IHB1YmxpYzsgT3duZXI6IHBvc3RncmVz Ci0tCgpDUkVBVEUgRlVOQ1RJT04gYWRkKGludGVnZXIsIGludGVnZXIpIFJF VFVSTlMgaW50ZWdlcgogICAgTEFOR1VBR0Ugc3FsIElNTVVUQUJMRSBTVFJJ Q1QKICAgIEFTICRfJHNlbGVjdCAkMSArICQyOyRfJDsKCgpBTFRFUiBGVU5D VElPTiBwdWJsaWMuYWRkKGludGVnZXIsIGludGVnZXIpIE9XTkVSIFRPIHBv c3RncmVzOwoKLS0KLS0gUG9zdGdyZVNRTCBkYXRhYmFzZSBkdW1wIGNvbXBs ZXRlCi0tCgo= --_233E7D4D-F7D3-48EE-AE5A-323338508068_ Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --_233E7D4D-F7D3-48EE-AE5A-323338508068_--