Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 129816

All versions of PostgreSQL. Add an additional version-specific tag like [postgresql-13] if that context is relevant.

1 vote
2 answers
2k views

postgres update parent if entity / foreign key updates

I have a table recipes and every recipe can have multiple entries. CREATE TABLE IF NOT EXISTS "recipes" ( "ident" SERIAL PRIMARY KEY, "identifier" TEXT NOT NULL UNIQUE, "modified_on" TIME …
Dominic Jonas's user avatar
1 vote
Accepted

postgres update parent if entity / foreign key updates

Here is my solution. CREATE OR REPLACE FUNCTION update_recipe_timestamp_from_entry_proc() RETURNS TRIGGER AS $$ BEGIN UPDATE recipes SET modified_on = now() WHERE ident = NEW."recipe_id"; PER …
Dominic Jonas's user avatar
13 votes
3 answers
41k views

Postgres update a table (only) if it exists

I have a Server and several Client Applications. The Server has to be started before a client can be started. The clients then create tables in the database if they don't exists. When the Server is s …
Dominic Jonas's user avatar