Christopher Tyler

Generate CREATE TABLE query for an existing table

Using command line tool:

pg_dump -t 'schema_name.table_name' --schema-only database_name

as an example:

1
> & 'C:\Program Files\PostgreSQL\17\bin\pg_dump.exe' -p 5432 -U postgres -t 'engsql.sixspeed_tehcmstepresults' --schema-only raw_test_data

Thanks to TablePlus for the info!

<< Previous Post

|

Next Post >>

#Postgresql #Create Table