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

  • SEARCH
  • Home
  • 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 8652321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:16:56+00:00 2026-06-12T14:16:56+00:00

I have a database schema named: nyummy and a table named cimory : create

  • 0

I have a database schema named: nyummy and a table named cimory:

create table nyummy.cimory (
  id numeric(10,0) not null,
  name character varying(60) not null,
  city character varying(50) not null,
  CONSTRAINT cimory_pkey PRIMARY KEY (id)
);

I want to export the cimory table’s data as insert SQL script file. However, I only want to export records/data where the city is equal to ‘tokyo’ (assume city data are all lowercase).

How to do it?

It doesn’t matter whether the solution is in freeware GUI tools or command line (although GUI tools solution is better). I had tried pgAdmin III, but I can’t find an option to do this.

  • 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-06-12T14:16:57+00:00Added an answer on June 12, 2026 at 2:16 pm

    Create a table with the set you want to export and then use the command line utility pg_dump to export to a file:

    create table export_table as 
    select id, name, city
    from nyummy.cimory
    where city = 'tokyo'
    
    $ pg_dump --table=export_table --data-only --column-inserts my_database > data.sql
    

    --column-inserts will dump as insert commands with column names.

    --data-only do not dump schema.

    As commented below, creating a view in instead of a table will obviate the table creation whenever a new export is necessary.

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

Sidebar

Related Questions

I have the next database schema: CREATE TABLE A (id INTEGER); CREATE TABLE Single_Values
I have a database schema where the convention for a foreign key's name is:
I have no control over database schema and have the following (simplified) table structure:
In my SQL Server database schema I have a data table with a date
I have a PostgreSQL database for my Rails application. In the schema named 'public'
Given a table named person (in a MySQL database/schema), kind of like this one:
I have the following schema for the generation of a table/model class named Account
I have the following database schema (names changed to protect the innocent) Code Table
We have recently improved the schema of our production database, changing column names and
I have a database schema in SQL 2005 that I want to copy to

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.