Question: how to generate create table script in postgresql?
Answer: IF OBJECT_ID('dbo.Table1', 'U') IS NOT NULL.
DROP TABLE dbo.Table1.
GO.
CREATE TABLE dbo.Table1 (ColumnID INT PRIMARY KEY)
GO.
EXEC sys.sp_helptext 'dbo.Table1'
SELECT OBJECT_DEFINITION(OBJECT_ID('dbo.Table1', 'U'))