pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
issue with C functions using pg_dump
4+ messages / 2 participants
[nested] [flat]

* issue with C functions using pg_dump
@ 2017-08-26 18:08 Cédric Prin-Derre <prinderr@gmail.com>
  2017-08-26 19:36 ` Re: issue with C functions using pg_dump Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Cédric Prin-Derre @ 2017-08-26 18:08 UTC (permalink / raw)
  To: pgsql-bugs

greeting,

i am am doing some test using the Adventureworks sample database (available
on postgresql wiki) and i have noticed an issue with pgdump

pg_dump --dbname=postgresql://postgres:xxx@127.0.0.1:5432/Adventureworks
--no-owner --format=plain --schema=public  --file="D:\public.sql"


the generated sql file does not contain the code of the LANGUAGE c
functions stored in this schema

could you please confirm it's a bug ?


regards

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
Garanti
sans virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: issue with C functions using pg_dump
  2017-08-26 18:08 issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
@ 2017-08-26 19:36 ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-08-26 21:25   ` Re: issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2017-08-26 19:36 UTC (permalink / raw)
  To: Cédric Prin-Derre <prinderr@gmail.com>; +Cc: pgsql-bugs

=?UTF-8?B?Q8OpZHJpYyBQcmluLURlcnJl?= <prinderr@gmail.com> writes:
> i am am doing some test using the Adventureworks sample database (available
> on postgresql wiki) and i have noticed an issue with pgdump
> pg_dump --dbname=postgresql://postgres:xxx@127.0.0.1:5432/Adventureworks
> --no-owner --format=plain --schema=public  --file="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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: issue with C functions using pg_dump
  2017-08-26 18:08 issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
  2017-08-26 19:36 ` Re: issue with C functions using pg_dump Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-08-26 21:25   ` Cédric Prin-Derre <prinderr@gmail.com>
  2017-08-26 21:37     ` Re: issue with C functions using pg_dump Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Cédric Prin-Derre @ 2017-08-26 21:25 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

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 :

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’s also the sql file generated with my command
(pg_dump --dbname=postgresql://postgres:xxx@127.0.0.1:5432/Adventureworks
--no-owner --format=plain --schema=public  --file="D:\public.sql")


Regards,

Provenance : Courrier pour Windows 10

De : Tom Lane
Envoyé le :samedi 26 août 2017 21:36
À : Cédric Prin-Derre
Cc : pgsql-bugs@postgresql.org
Objet :Re: [BUGS] issue with C functions using pg_dump

=?UTF-8?B?Q8OpZHJpYyBQcmluLURlcnJl?= <prinderr@gmail.com> writes:
> i am am doing some test using the Adventureworks sample database (available
> on postgresql wiki) and i have noticed an issue with pgdump
> pg_dump --dbname=postgresql://postgres:xxx@127.0.0.1:5432/Adventureworks
> --no-owner --format=plain --schema=public  --file="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 électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

  public.sql (application/octet-stream, 1.7K) download

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: issue with C functions using pg_dump
  2017-08-26 18:08 issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
  2017-08-26 19:36 ` Re: issue with C functions using pg_dump Tom Lane <tgl@sss.pgh.pa.us>
  2017-08-26 21:25   ` Re: issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
@ 2017-08-26 21:37     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2017-08-26 21:37 UTC (permalink / raw)
  To: Cédric Prin-Derre <prinderr@gmail.com>; +Cc: pgsql-bugs

=?utf-8?Q?C=C3=A9dric_Prin-Derre?= <prinderr@gmail.com> writes:
> i was hoping to just  get the create function code but i do not.

> Here s a sample of code not generated :

> CREATE OR REPLACE FUNCTION public.uuid_nil()

If you're looking for uuid_nil, the reason you're not seeing it
is that it's a member of the uuid-ossp extension.  pg_dump
will emit a CREATE EXTENSION command, not commands for all the
individual member objects.  You should look into the extension's
script file if you want to see the member objects' creation
commands.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2017-08-26 21:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-08-26 18:08 issue with C functions using pg_dump Cédric Prin-Derre <prinderr@gmail.com>
2017-08-26 19:36 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-08-26 21:25   ` Cédric Prin-Derre <prinderr@gmail.com>
2017-08-26 21:37     ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox