New answers tagged

3

You can do that with a column check: ALTER TABLE table ADD CHECK ((column->'id') is not null and (column->'name') is not null);


1

Here it is, 2016, El Capitan is out there, and Apple keeps changing things up. Postgres is installed as part of the OS, and the postgres config file sets the unix_socket_directories property in postgresql.conf to /tmp. The socket is in /tmp/.s.PGSQL.5432. I was able to get around the problem by executing the following: sudo ln -s /tmp /var/pgsql_socket ...


0

Yes, using DO, cursors, execute, and the pg_namespace table: DO $$DECLARE _schema record; _user name := '<your_username>' BEGIN FOR _schema IN SELECT * FROM pg_namespace WHERE nspowner > 10 OR nspname = 'public' LOOP EXECUTE 'GRANT SELECT, INSERT ON SCHEMA '|| quote_ident(_schema.nspname)||' TO '||quote_ident(_user); END ...



Top 50 recent answers are included