On SQlite I could do a query for PRAGMA user_version;
and I could set the version if need be too. Is there anything in postgres that could do the same thing?
I tried select version()
but that gets the literal version of postgres, and not a custom set version.
As an update: I researched commenting on databases. Perhaps this could be solution... commenting docs
3) Verify the Installation The quick way to verify the installation is through the psql program. First, click the psql application to launch it. The psql command-line program will display. Second, enter all the necessary information such as the server, database, port, username, and password.
Option 1: SELECT version() This option is handy for when you're connected to a PostgreSQL database using a GUI such as PgAdmin, DBeaver, Azure Data Studio, etc. But you can run the same query when you're connected to a PostgreSQL database using the psql command line interface (CLI).
You can set a custom configuration parameter. The parameter name must contain a dot, e.g.:
set my.version to 4;
select current_setting('my.version') as version;
version
---------
4
(1 row)
A parameter defined in this way is local to the current session. If you want to define a default value for the parameter for all sessions you can add it to the configuration file postgresql.conf
(for all databases in the server). Alternatively, it is possible to set the default value for a database in the command:
set my.version to 4;
alter database my_database set my.version from current;
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With