15 Sep 2017
Dummy Query for Postgres
What I meant by dummy query
is the query that doesn’t need table. This kind of query is may useful for unit testing.
Query 1: This is working for most sql
SELECT 'Anto' as name, 12 as age
UNION SELECT 'Linda', 9
UNION SELECT 'Mike', 10
Query 2:
SELECT *
FROM (values ('Anto', 12),('Linda', 9), ('Mike', 10) ) AS q (name, age)
Query 3: Single column with a lot of data
SELECT id FROM regexp_split_to_table('1,2,3,4,5,7,8,9', ',') AS id
Query 4: To expect more seconds for query. pg_sleep
usually used at blind sql injection.
SELECT 1 as id, pg_sleep(10)