You can fix your initial attempt like this:
SELECT md5(random()::text);
Much simpler than some of the other suggestions. 🙂
More Related Contents:
- quick random row selection in Postgres
- Postgres FOR LOOP
- What is PostgreSQL equivalent to autoincrement?
- How do I specify a password to ‘psql’ non-interactively?
- psql: FATAL: Ident authentication failed for user “postgres”
- Use multiple conflict_target in ON CONFLICT clause
- PostgreSQL -must appear in the GROUP BY clause or be used in an aggregate function
- How to find table creation time?
- Go and IN clause in Postgres
- How to add “on delete cascade” constraints?
- Is there a way to disable function overloading in Postgres
- Grant all on a specific schema in the db to a group role in PostgreSQL
- Migrate database from Postgres to MySQL [closed]
- How can I start PostgreSQL on Windows?
- PostgreSQL – max number of parameters in “IN” clause?
- SQLAlchemy, Psycopg2 and Postgresql COPY
- How to find out if an upsert was an update with PostgreSQL 9.5+ UPSERT?
- Why can I create a table with PRIMARY KEY on a nullable column?
- Oracle SQL Developer and PostgreSQL
- PostgreSQL array of elements that each are a foreign key
- Postgres error on insert – ERROR: invalid byte sequence for encoding “UTF8”: 0x00
- Can I use return value of INSERT…RETURNING in another INSERT?
- Changing a postgres containers server port in Docker Compose
- How do you find the disk size of a Postgres / PostgreSQL table and its indexes
- PostgreSQL – disabling constraints
- PostgreSQL authentication method 10 not supported
- Heroku database restore issue
- user postgres launches process that takes all CPUs 100% usage
- Postgres table column name restrictions?
- How do I get min, median and max from my query in postgresql?