Page 1 of 1

export_objects function not working?

Posted: Thu Dec 01, 2016 4:52 pm
by Josh
Hey,

I am trying to use the export objects function to get the code to create a table. But when I run it, I don't get the code.

This is what I am doing

Code: Select all

dbadmin=> \dt default_data;
                  List of tables
 Schema |     Name     | Kind  |  Owner  | Comment
--------+--------------+-------+---------+---------
 public | default_data | table | dbadmin |
(1 row)

dbadmin=> select export_objects('','default_data');
                        export_objects
---------------------------------------------------------------
 CREATE SCHEMA default_data;




SELECT MARK_DESIGN_KSAFE(0);

(1 row)

Re: export_objects function not working?

Posted: Thu Dec 01, 2016 5:33 pm
by JimKnicely
Do you have a schema named "default_data"? I bet you do, and that is what the EXPORT_OBJECTS function is referencing :)

Just add the schema "PUBLIC" to your command:

select export_objects('','public.default_data');

Re: export_objects function not working?

Posted: Thu Dec 01, 2016 10:24 pm
by Josh
Heh heh. That was it! Thanks for that :oops: