"Martin L. Buchanan" writes:
> Reading the documentation I found no built-in function for integer square
> root, requiring a sequence of:
> floor(sqrt(foo))::integer
> to go from an integer to the integer square root as an integer.
I'm a little down on this idea, mainly because I doubt there is a
On 12/17/22 20:40, Martin L. Buchanan wrote:
Dear Rob and all readers:
Generating prime numbers is one example where you use integer square
root in the inner loop, going from integer to integer.
Calculating an integer square root from an integer input may have a
more efficient algorithm than
Dear Rob and all readers:
Generating prime numbers is one example where you use integer square root
in the inner loop, going from integer to integer.
Calculating an integer square root from an integer input may have a more
efficient algorithm than doing so in floating-point, with the caveat that
On 12/17/22 19:39, Martin L. Buchanan wrote:
Dear PostgreSQL colleagues:
I have just joined this, my first PG mailing list.
Reading the documentation I found no built-in function for integer
square root, requiring a sequence of:
floor(sqrt(foo))::integer
to go from an integer to the integer
Dear PostgreSQL colleagues:
I have just joined this, my first PG mailing list.
Reading the documentation I found no built-in function for integer square
root, requiring a sequence of:
floor(sqrt(foo))::integer
to go from an integer to the integer square root as an integer.
If PG leaders smile
My bad - was referencing the wrong column with PQgetvalue(). With that
corrected, get 8332 for 2022-10-25. So date is an integer day count
from POSTGRES_EPOCH_JDATE
(2000-01-01).
Thanks for the help!
---
On Sun, Dec 18, 2022 at 8:24 AM David G. Johnston <
david.g.johns...@gmail.com>
On Sat, Dec 17, 2022 at 4:55 PM Michael Arnold wrote:
> How do I interpret the 4 bytes of postgresql 'date' value?
>
See date2j and j2date in datetime.c
timestamp.h has the relevant constant Tom refers to (POSTGRES_EPOCH_JDATE)
David J.
Michael Arnold writes:
> Something like this:
> int32_t date_val = be32toh(*((uint32_t *) PQgetvalue(res, 0, 17)));
> Gives date_val=1,466,004,328 for 2022-10-25.
The origin is 2000-01-01 (I'm pretty sure that's documented somewhere),
so the correct integer value for that date is 8333 by my m
Want to retrieve a date type from a postgres table using libpq
PQexecParams() in binary mode (please humor me).
https://www.postgresql.org/docs/14/datatype-datetime.html says that a date
is 4 bytes (4713 BC to 5874897 AD). src/include/utils/date.h defines:
typedef int32 DateADT;
Something like
On Sat, Dec 17, 2022, at 3:22 PM, Dan Langille wrote:
> On Sat, Dec 17, 2022, at 3:14 PM, Dan Langille wrote:
>> On Sat, Dec 17, 2022, at 2:55 PM, Tom Lane wrote:
>>> "Dan Langille" writes:
pkgmessage_textsearchable2 | tsvector | |
| generated always
On Sat, Dec 17, 2022, at 3:14 PM, Dan Langille wrote:
> On Sat, Dec 17, 2022, at 2:55 PM, Tom Lane wrote:
>> "Dan Langille" writes:
>>> pkgmessage_textsearchable2 | tsvector | |
>>> | generated always as (to_tsvector('english'::regconfig,
>>> translate(pkgmess
On Sat, Dec 17, 2022, at 2:55 PM, Tom Lane wrote:
> "Dan Langille" writes:
>> pkgmessage_textsearchable2 | tsvector | |
>> | generated always as (to_tsvector('english'::regconfig,
>> translate(pkgmessage, '/'::text, ' '::text))) stored
>
> That is not likely t
"Dan Langille" writes:
> pkgmessage_textsearchable2 | tsvector | |
> | generated always as (to_tsvector('english'::regconfig,
> translate(pkgmessage, '/'::text, ' '::text))) stored
That is not likely to play well with this:
> freshports.org=> show default_t
On Sat, Dec 17, 2022, at 1:53 PM, Dan Langille wrote:
> Under PostgreSQL 12, I have a table using tsvector to search the column
> pkgmessage.
>
> It looks like this (not all columns are shown).
>
>
> Table "public
Under PostgreSQL 12, I have a table using tsvector to search the column
pkgmessage.
It looks like this (not all columns are shown).
Table "public.ports"
Column | Type | C
15 matches
Mail list logo