Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10

2019-04-27 Thread Andrew Gierth
> "Matthias" == Matthias Apitz writes: Matthias> There is no cmd 'pg_config'. Can I compile this from source? Some distros separate out a 'libpq' package, and have a 'libpq-devel' package with pg_config in it. Did you look for that? -- Andrew (irc:RhodiumToad)

Re: ERROR: operator does not exist: timestamp without time zone + integer

2019-04-30 Thread Andrew Gierth
> "Adrian" == Adrian Klaver writes: Adrian> Or cast to a date: Adrian> test=> select date_trunc('day', localtimestamp)::date + 7; yeesh. that's a very long-winded way to write current_date + 7 -- Andrew (irc:RhodiumToad)

Re: ERROR: operator does not exist: timestamp without time zone + integer

2019-04-30 Thread Andrew Gierth
> "Adrian" == Adrian Klaver writes: >> yeesh. that's a very long-winded way to write current_date + 7 Adrian> Yeah, I was just working of the OP's original DEFAULT: Adrian> site_mode_date timestamp NOT NULL DEFAULT date_trunc('day', Adrian> LOCALTIMESTAMP)+7, Right, but since all these

Re: Back Slash \ issue

2019-05-03 Thread Andrew Gierth
> "Guntry" == Guntry Vinod writes: Guntry> Hi Team, Guntry> We are using the below command Guntry> COPY <> from 'C:\Data_Dump\ABC.txt' DELIMITER '|'; COPY in postgresql expects one of two data formats; since you did not specify CSV, in this case it's expecting the default postgresql fo

Re: Strange performance degregation in sql function (PG11.1)

2019-05-18 Thread Andrew Gierth
> "Alastair" == Alastair McKinley writes: Alastair> Hi all, Alastair> I recently experienced a performance degradation in an Alastair> operational system that I can't explain. I had a function Alastair> wrapper for a aggregate query that was performing well using Alastair> the expected

Re: Feature request (or at least discussion): enable autovaccum on temp tables

2019-05-31 Thread Andrew Gierth
> "Ivan" == Ivan Voras writes: Ivan> Since AFAIK temp tables are very close to unlogged ordinary Ivan> tables, what would stop this feature from being implemented? The key difference between temp tables and other tables is that temp table data does not use the shared_buffers but is buffere

Re: Two small questions re/ COPY CSV data into table

2019-06-04 Thread Andrew Gierth
> "Matthias" == Matthias Apitz writes: Matthias>... WITH DELIMITER '|', FORMAT CSV ; I think you misread the docs; the new-style syntax would be COPY ... WITH (DELIMITER '|', FORMAT CSV); where the parens are not optional. The old-style syntax with no parens after WITH is what you wer

Re: Research on ?? operators

2019-06-04 Thread Andrew Gierth
> "Matteo" == Matteo Beccati writes: Matteo> https://wiki.php.net/rfc/pdo_escape_placeholders Matteo> One question that I'm supposed to answer now is: is there any Matteo> known usage in the wild of some custom "??" operator that would Matteo> require funny escaping like ""? I don't

Re: Two small questions re/ COPY CSV data into table

2019-06-04 Thread Andrew Gierth
> "Matthias" == Matthias Apitz writes: >> That sounds like the file is not actually a CSV - why do you think >> it is? Matthias> Well, it's not strictly CSV, In other words it's not a CSV at all. Matthias> I do load this now with COPY in mode TEXT and modify the data Matthias> before

Re: Two small questions re/ COPY CSV data into table

2019-06-04 Thread Andrew Gierth
> "Matthias" == Matthias Apitz writes: Matthias> sed 's/|/\v/g' < table-from-Sybase | sed 's/\\\v/|/g' > table-for-copy >> What on earth is this supposed to achieve? Matthias> It first translates any char '|' to vtab and then any '\vtab' Matthias> (i.e. a backslash followed by a vtab

Re: Two small questions re/ COPY CSV data into table

2019-06-04 Thread Andrew Gierth
> "Matthias" == Matthias Apitz writes: Matthias> it is exported into the file as Matthias> cmd \| lpr ... Matthias> because the export delimiter is set to '|'; Matthias> the COPY in text mode was complaining because it interpreted Matthias> the | of the sequence \| as an delimite

Re: found xmin * from before relfrozenxid *

2019-06-12 Thread Andrew Gierth
> "Evaldas" == Evaldas Užpalis writes: Evaldas> Hello PostgresSQL users and admins, Evaldas> I need some help with my problem. Evaldas> I looked at postgresql logs and it is littered with error messages like: Evaldas> ERROR:  found xmin 3875696185 from before relfrozenxid 1599104090 E

Re: [EXT EMAIL] Re: First Time Starting Up PostgreSQL and Having Problems

2019-06-19 Thread Andrew Gierth
> "Rob" == Rob Sargent writes: >>> local all all trust Rob> That line has four values and the header has 5. That's standard for "local" lines, which lack an ADDRESS field. -- Andrew (irc:RhodiumToad)

Re: "Time of latest checkpoint" stays too old on both master and slave

2019-06-30 Thread Andrew Gierth
> "rihad" == rihad writes: rihad> There's a weird problem, even when the time is initially set by rihad> openntpd it keeps lagging by one second every few seconds: rihad> $ sudo /usr/local/etc/rc.d/openntpd restart What OS is this? I've seen this kind of thing with FreeBSD where the ke

Re: Argument casting hierarchy?

2019-07-01 Thread Andrew Gierth
> "Wells" == Wells Oliver writes: Wells> Hi guys, hoping you can help clarify what the 'hierarchy' of Wells> casts might be in function arguments. In terms of which casts will be selected in some given context, there isn't exactly a "hierarchy", but some types are designated as "preferred"

Re: "PANIC: could not open critical system index 2662" - twice

2023-05-05 Thread Andrew Gierth
> "Evgeny" == Evgeny Morozov writes: Evgeny> Indeed, I cannot get that far due to the same error. I read Evgeny> about ignore_system_indexes, but... Evgeny> # sudo -u postgres psql -w -p 5434 -c "set ignore_system_indexes=on"; Evgeny> ERROR:  parameter "ignore_system_indexes" cannot be s

Re: Check that numeric is zero

2023-05-06 Thread Andrew Gierth
> "Gabriel" == Gabriel Furstenheim Milerud writes: Gabriel> Hi, Gabriel> I'm writing a Postgres native extension and I would like to Gabriel> check that a numeric is zero. Gabriel> My problem is that all exported methods like numeric_eq or Gabriel> numeric_sign require me to have a num

Re: Return rows in input array's order?

2023-05-10 Thread Andrew Gierth
> "Dominique" == Dominique Devienne writes: Dominique> Hi. With an integer identity primary key table, Dominique> we fetch a number of rows with WHERE id = ANY($1), Dominique> with $1 an int[] array. The API using that query must return Dominique> rows in the input int[] array order, and

Re: Return rows in input array's order?

2023-05-10 Thread Andrew Gierth
> "Dominique" == Dominique Devienne writes: Dominique> Is it possible to maintain $1's order directly in SQL? >> This is the correct way: >> >> SELECT ... FROM unnest($1) WITH ORDINALITY AS u(id,ord) >> JOIN yourtable t ON t.id=u.id >> ORDER BY u.ord; Dominique> Thanks Andrew, for s

Re: Window function for get the last value to extend missing rows

2023-05-12 Thread Andrew Gierth
> "Durumdara" == Durumdara writes: Durumdara> I have to make a virtual table which is minute based. Durumdara> I thought I would make a generated temp table Durumdara> (generate_series) and then join these values based on minue. Durumdara> 03:00 10 Durumdara> 03:01 NULL Durum

<    1   2