pg_dump 输出导入csv文件的过程
命令如下:
pg_dump -t public.global_24h --schema-only -U postgres postgis_32_sample
其中参数:
参数 | 含义 |
---|---|
-t public.global_24h | 表名称 |
-U postgres | 用户名 |
postgis_32_sample | 数据库名称 |
--schema-only | 只转储模式, 不包括数据 |
输出结果如下:
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.9
-- Dumped by pg_dump version 12.9
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: global_24h; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.global_24h (
ogc_fid integer NOT NULL,
latitude character varying,
longitude character varying,
brightness character varying,
scan character varying,
track character varying,
acq_date character varying,
acq_time character varying,
satellite character varying,
confidence character varying,
version character varying,
bright_t31 character varying,
frp character varying,
the_geom public.geometry(Point,3857)
);
ALTER TABLE public.global_24h OWNER TO postgres;
--
-- Name: global_24h_ogc_fid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.global_24h_ogc_fid_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.global_24h_ogc_fid_seq OWNER TO postgres;
--
-- Name: global_24h_ogc_fid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.global_24h_ogc_fid_seq OWNED BY public.global_24h.ogc_fid;
--
-- Name: global_24h ogc_fid; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.global_24h ALTER COLUMN ogc_fid SET DEFAULT nextval('public.global_24h_ogc_fid_seq'::regclass);
--
-- Name: global_24h global_24h_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.global_24h
ADD CONSTRAINT global_24h_pkey PRIMARY KEY (ogc_fid);
--
-- Name: global_24h_the_geom_geom_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX global_24h_the_geom_geom_idx ON public.global_24h USING gist (the_geom);
--
-- PostgreSQL database dump complete
--