4

Is there a way to drop all the data types listed by \dT+.

I know you can drop types individually via DROP TYPE command, but I have a lot of types and it's painstaking to drop them all individually.

user886596
  • 2,380
  • 5
  • 31
  • 53

1 Answers1

2

Following the directions suggested by user Schwern, I used psql -E and got this to work:

  1. Run SELECT typname, typnamespace from pg_type;
  2. Figure out what typnamespace your types are associated with
  3. DELETE FROM pg_type WHERE typnamespace=${your_typnamespace}
jiminikiz
  • 2,867
  • 1
  • 25
  • 28
user886596
  • 2,380
  • 5
  • 31
  • 53