Snippets
Handy snippets to help you set up Postgres to work with Stacksync
Create a Primary Key
CREATE TABLE public."my_table" (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
my_column varchar,
-- other columns here
);CREATE TABLE my_table (
id serial PRIMARY KEY,
my_column varchar,
-- other columns here
);Alter a Primary Key
Create a User with restricted access rights on your database
Grant user read and write access rights on a specific existing table
Create a new column in Postgres
Last updated