Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7657475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:02:27+00:00 2026-05-31T13:02:27+00:00

I use following command to dump some structures from server’ database to be able

  • 0

I use following command to dump some structures from server’ database to be able to create sample of data on my local hard drive.

pg_dump -h myserver.com -U product_user -s -f ./data/base.structure.postgresql.sql -F p -v -T public.* -T first_product.* -T second_product.* -T another_product.locales mydatabase

I need to exclude some schemas otherwise it would ended up on permissions or other errors. Even that I exclude schema public, it dumps all functions in that schema, like this:

REVOKE ALL ON FUNCTION gin_extract_trgm(text, internal) FROM PUBLIC;
psql:./data/base.structure.postgresql.sql:8482: ERROR:  function gin_extract_trgm(text, internal) does not exist

I know this comes from the fulltext or similarity plugin in PostgreSQL, but I don’t use it and don’t need it on my machine, so I’d like to exclude these functions.

How could I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:02:28+00:00Added an answer on May 31, 2026 at 1:02 pm

    I need to exclude some schemas

    pg_dump has a switch to exclude schemas:

    pg_dump -N schema ...
    

    I quote the manual about pg_dump:

    -N schema
    –exclude-schema=schema

    Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n. -N can be given
    more than once to exclude schemas matching any of several patterns.
    …


    With PostgreSQL 9.1 or later you have new options to move extensions into a separate schema – even pre-installed old-style modules. You can register old object with your (new-style) extension and then use the new tools. With fulltext and similarity you probably mean fuzzystrmatch and tsearch2. Example:

    Register existing old-style objects for the extension fuzzystrmatch:

    CREATE EXTENSION fuzzystrmatch SCHEMA public FROM unpackaged;
    

    Drop the extension:

    DROP EXTENSION fuzzystrmatch;
    

    Install it to another schema:

    CREATE EXTENSION fuzzystrmatch SCHEMA my_schema;
    

    Of course, you cannot drop the extension, if objects from it are in use.
    Also, if you install to another schema, you need to schema-qualify its functions in use or add the schema to the search_path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Step 1, I use the following command to get my local IE version from
for example i use following command to find a record SELECT `users`.`mail` FROM `users`
I use the following command to read in a csv: LOAD DATA INFILE '/Users/Tyler/Desktop/players_escaped.txt'
I use the following rsync command to backup my MySQL data to a machine
I use the following command to find under /var some param in my script
I use the following command in some old scripts: curl -Lk https:www.example.com/stuff/api.php? I then
I create a custom schema in my DB2 database using the following command: db2
I can use the following command to find out if a Windows Terminal Server
I currently use the following command, but it's a little unwieldy to type. What's
I want to use the following command: openssl x509 -noout -in /etc/pki/tls/certs/cert1.pem -enddate openssl

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.