How to prompt for a value if a variable is not set

From: randy(at)strausses(dot)net
To: pgsql-docs(at)postgresql(dot)org
Subject: How to prompt for a value if a variable is not set
Date: 2017-09-19 03:03:11
Message-ID: 20170919030311.17350.55315@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.2/static/app-psql.html
Description:

I want to make a small script to show the primary key for a table and put
the name into a variable.

Called from another script, the tablename is set in a variable called
tablename. But if the variable is not set, I want the script to prompt for
it.

Is there a way to do this?
thx,
-r

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Euler Taveira 2017-09-19 15:41:47 Re: instr
Previous Message jonny.battiato 2017-09-18 17:04:50 max_replication_slots in subscriber for subscription?