You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/04/27 05:48:24 UTC

[GitHub] [shardingsphere] tuichenchuxin opened a new issue, #17137: Support get ddl sql from Postgres

tuichenchuxin opened a new issue, #17137:
URL: https://github.com/apache/shardingsphere/issues/17137

   ## what is it like
   mysql has show create table statement, but postgres don't have one.
   I want to offer a method to get the create sql 
   like use pg_dump, we can get the create table sql, constriants and comments etc.
    
   ```
   docker exec -it my_postgres pg_dump -U postgres -d demo_ds_0 -h host.docker.internal -s -t t_order_0
   Password:
   --
   -- PostgreSQL database dump
   --
   
   -- Dumped from database version 14.2 (Debian 14.2-1.pgdg110+1)
   -- Dumped by pg_dump version 14.2 (Debian 14.2-1.pgdg110+1)
   
   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: t_order_0; Type: TABLE; Schema: public; Owner: postgres
   --
   
   CREATE TABLE public.t_order_0 (
       order_id integer NOT NULL,
       user_id integer NOT NULL,
       status character varying(45)
   );
   
   
   ALTER TABLE public.t_order_0 OWNER TO postgres;
   
   --
   -- Name: TABLE t_order_0; Type: COMMENT; Schema: public; Owner: postgres
   --
   
   COMMENT ON TABLE public.t_order_0 IS 'haha';
   
   
   --
   -- Name: COLUMN t_order_0.order_id; Type: COMMENT; Schema: public; Owner: postgres
   --
   
   COMMENT ON COLUMN public.t_order_0.order_id IS 'haha';
   
   
   --
   -- Name: t_order_0 t_order_0_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
   --
   
   ALTER TABLE ONLY public.t_order_0
       ADD CONSTRAINT t_order_0_pkey PRIMARY KEY (order_id);
   
   
   --
   -- PostgreSQL database dump complete
   --
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tuichenchuxin closed issue #17137: Support get logic ddl sql

Posted by GitBox <gi...@apache.org>.
tuichenchuxin closed issue #17137: Support get logic ddl sql 
URL: https://github.com/apache/shardingsphere/issues/17137


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #17137: Support get logic ddl sql

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #17137:
URL: https://github.com/apache/shardingsphere/issues/17137#issuecomment-1143421753

   Hi @tuichenchuxin 
   Have we finished this issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org