O
O
olamedia.2015-03-18 15:51:59
PostgreSQL
olamedia., 2015-03-18 15:51:59

Postgresql uuid < $1, is it possible?

There is an id column, type uuid, you need to get the records before / after a certain value (the last record from the previous request).
Example of a subquery with pre-trimming by time:
SELECT * FROM table WHERE created_at <= $1
Of course, the probability of inserting in one second is small, in which case a simple query could be used SELECT * FROM table WHERE created_at < $1(especially if the insertion time is generated by the base itself with an accuracy in seconds of the order of 6 decimal places), but with hitting the same record in the sample can have very undesirable consequences. That's why I want to do an additional check.
For example, as an option - a function that filters rows, which would skip rows until they match, then change the state of the internal variable and return all rows after that without changes - with a certain limit.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vyacheslav Uspensky, 2015-03-25
@Kwisatz

In what a problem to get an autoincremental field?
If you don't like autoincrement by 1, then take the created sequence and change it as you like.

A
Andrey Goncharov, 2018-01-26
@agmegadeth

You have some left characters in the bootstrap js and in the magnific popup js. Everything is written in the console.

O
OKyJIucT, 2018-01-26
@OKyJIucT

Download js files from sites and re-upload. And then there the Chinese walked in the code.

Screenshot
5a6b1a3fc04fe829979839.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question