Re: CREATE SCHEMA IF NOT EXISTS

Volker Grabsch <vog@notjusthosting.com>

From: Volker Grabsch <vog@notjusthosting.com>
To: "Dickson S. Guedes" <listas@guedesoft.net>
Cc: fabriziomello@gmail.com, Pgsql Hackers <pgsql-hackers@postgresql.org>, david@justatheory.com
Date: 2012-09-29T09:32:13Z
Lists: pgsql-hackers
Dickson S. Guedes schrieb:
> - https://commitfest.postgresql.org/action/patch_view?id=907
> 
> The patch is small and implements a new syntax to CREATE SCHEMA
> that allow the creation of a schema be skipped when IF NOT EXISTS is
> used.
>
> [...]
>
> - Should this patch implements others INEs like ADD COLUMN IF NOT EXISTS?

If there's still a chance to improve the patch, I'd love to see
the following INEs implemented. Several real-world database
upgrade scripts would benefit from those:

1)
CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] name ...

2)
ALTER TABLE ... ADD [ COLUMN ] [ IF NOT EXISTS ] column_name ...

3)
CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ IF NOT EXISTS ] [ name ] ON ...


Regards,
Volker

-- 
Volker Grabsch
---<<(())>>---


Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Document the lack of reading the PGDATABASE environment variable in