Re: Is there a way to replace select * fields in result ?

2021-06-12 Thread Condor
On 12-06-2021 11:13, David G. Johnston wrote: On Saturday, June 12, 2021, Condor wrote: Hello, Is there a way to replace select * fileds in result ? I have select qw.* from table but I want field for example mm to be replaced with custom value like: select qw.*, case whem length(qw.mm) >

Is there a way to replace select * fields in result ?

2021-06-12 Thread Condor
Hello, Is there a way to replace select * fileds in result ? I have select qw.* from table but I want field for example mm to be replaced with custom value like: select qw.*, case whem length(qw.mm) > 0 THEN COALESCE(SUBSTRING(qw.mm, 1, 1), '') ELSE qw.mm END AS qw.mm Is there some way to

Re: Question about integer out of range in function

2021-05-16 Thread Condor
On 14-05-2021 17:42, Tom Lane wrote: Condor writes: new_time = fromtime * 1000; -- here is line 19 Are you entirely certain that you counted lines correctly? If new_time and fromtime are both declared bigint, and fromtime is on the order of # select extract(epoch from now())::bigint

Re: Question about integer out of range in function

2021-05-14 Thread Condor
On 14-05-2021 17:42, Tom Lane wrote: Condor writes: new_time = fromtime * 1000; -- here is line 19 Are you entirely certain that you counted lines correctly? If new_time and fromtime are both declared bigint, and fromtime is on the order of # select extract(epoch from now())::bigint

Question about integer out of range in function

2021-05-13 Thread Condor
Hello ppl, I have a question about ERROR: integer out of range in one function. I modify the generate_ulid() function to accept also UNIX timestamp as input parameter. I drop old function and make new one: CREATE FUNCTION generate_ulid(fromtime bigint default 0) Then I declare two new var

Re: Question about contrib

2021-04-19 Thread Condor
On 19-04-2021 11:50, Guillaume Lelarge wrote: Le lun. 19 avr. 2021 à 10:43, Condor a écrit : On 19-04-2021 11:39, Guillaume Lelarge wrote: Hi, Le lun. 19 avr. 2021 à 09:43, Condor a écrit : Hello, I have a question about contrib directory. I know the projects there is not official

Re: Question about contrib

2021-04-19 Thread Condor
On 19-04-2021 11:39, Guillaume Lelarge wrote: Hi, Le lun. 19 avr. 2021 à 09:43, Condor a écrit : Hello, I have a question about contrib directory. I know the projects there is not official supported by PostgreSQL development team Contrib modules (as in the contrib subdirectory) are

Question about contrib

2021-04-19 Thread Condor
Hello, I have a question about contrib directory. I know the projects there is not official supported by PostgreSQL development team and I wanna ask, what will be happened if the leader of project pg_crypto for example (I repeat for example) leave the project for example in pgsql 13 and pro

Re: Question about PG_CONTROL_VERSION 1

2021-04-16 Thread Condor
On 14-04-2021 17:41, Tom Lane wrote: Condor writes: I try restore from old hard drive an database. The system is not working, so I install new server, install postgres 9.0.3 and try to copy postgresql dir to new location but I receive error: 2021-04-14 11:47:04.205 UTC [10285] FATAL

Question about PG_CONTROL_VERSION 1

2021-04-14 Thread Condor
Hello, I try restore from old hard drive an database. The system is not working, so I install new server, install postgres 9.0.3 and try to copy postgresql dir to new location but I receive error: 2021-04-14 11:47:04.205 UTC [10285] FATAL: database files are incompatible with server 2021-04

Re: The Amazon CloudFront distribution is configured to block access from your country.

2021-04-12 Thread Condor
On 12-04-2021 17:53, felix.quin...@yahoo.com wrote: The entire enterprisedb site is blocked for me. It's an American company, so I imagine it's happening. In the end I ended up downloading it from www.download3k.es. I checked the installer certificate and it seems to be correct. Thank you very m

Re: Need help with trigger

2021-01-24 Thread Condor
#x27; (formerly ' || d.dname || ')' WHERE d.zipcode <> '21201'; On Sat, Jan 23, 2021 at 3:47 PM Adrian Klaver wrote: On 1/23/21 12:14 PM, Condor wrote: On 23-01-2021 20:49, Adrian Klaver wrote: On 1/23/21 10:20 AM, Condor wrote: Sorry, I'm sorry, I don

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 20:49, Adrian Klaver wrote: On 1/23/21 10:20 AM, Condor wrote: On 23-01-2021 18:31, Adrian Klaver wrote: On 1/23/21 4:57 AM, Condor wrote: So do an UPDATE and the RETURN NULL to cancel the INSERT. Untested example: UPDATE arhive_table SET sendto = 0, uts = date_part

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 18:31, Adrian Klaver wrote: On 1/23/21 4:57 AM, Condor wrote: Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What is the table being read

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 18:17, David G. Johnston wrote: On Saturday, January 23, 2021, Condor wrote: Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What I want is: if

Need help with trigger

2021-01-23 Thread Condor
Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What I want is: if data already inserted and end_date is not changed, only to update lastseen column. If data

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-17 Thread Condor
On 17-11-2020 11:00, Thomas Munro wrote: On Tue, Nov 17, 2020 at 8:02 PM Condor wrote: I try to compile postgres again with (cd src/backend/commands; sed 's/TRUE/true/' collationcmds.c > collationcmds.c; ) and it's compiled but get new error on linking: Doesn't tha

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Condor
On 16-11-2020 22:18, Tom Lane wrote: I wrote: What's wrong with s/TRUE/true/ in get_icu_language_tag? I confirmed that that fixes the build with ICU 68.1, and pushed it. regards, tom lane Hello, I try to compile postgres again with (cd src/backend/commands; sed 's

Re: Unable to compile postgres 13.1 on Slackware current x64

2020-11-16 Thread Condor
On 16-11-2020 11:10, Laurenz Albe wrote: On Mon, 2020-11-16 at 09:15 +0200, Condor wrote: unable to compile Postgresql 13.0 and 13.1 on Slackware current x64. Here is gcc -v: Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/9.3.0/specs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec

Unable to compile postgres 13.1 on Slackware current x64

2020-11-15 Thread Condor
Hello, unable to compile Postgresql 13.0 and 13.1 on Slackware current x64. Here is gcc -v: Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/9.3.0/specs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/9.3.0/lto-wrapper Target: x86_64-slackware-linux Configur

Re: Need help how to reproduce MySQL binary to PosgreSQL

2020-08-09 Thread Condor
_ [2] On Sun, Aug 9, 2020 at 11:42 AM Condor wrote: Hello, how I can reproduce MySQL binary to PosgreSQL and use follow functionality in PG. On mysql I have table with 3 fields: CREATE TABLE table ( user_id int, user_info binary(4), user_data binary(16) ); then I use them for example: UPDATE t

Need help how to reproduce MySQL binary to PosgreSQL

2020-08-08 Thread Condor
Hello, how I can reproduce MySQL binary to PosgreSQL and use follow functionality in PG. On mysql I have table with 3 fields: CREATE TABLE table ( user_id int, user_info binary(4), user_data binary(16) ); then I use them for example: UPDATE table set user_info = CHAR(0, 2, 0, 0), us

Re: How to avoid UPDATE on same data in table ?

2020-02-03 Thread Condor
On 03-02-2020 10:29, Andrei Zhidenkov wrote: Have you tried to use built-in suppress_redundant_updates_trigger[1] for this? 1. https://www.postgresql.org/docs/12/functions-trigger.html No, solution point me Adrian Klaver it's working for me. I look at page, but this probably is build in func

Re: How to avoid UPDATE on same data in table ?

2020-02-03 Thread Condor
On 02-02-2020 23:06, Adrian Klaver wrote: On 2/2/20 1:24 AM, Condor wrote: Hello, I'm using PostgreSQL 12.1 and trying to avoid update on table when data is the same. I read somewhere if UPDATE is with the same data SQL server on system level does not do update on table but don'

How to avoid UPDATE on same data in table ?

2020-02-02 Thread Condor
Hello, I'm using PostgreSQL 12.1 and trying to avoid update on table when data is the same. I read somewhere if UPDATE is with the same data SQL server on system level does not do update on table but don't know if that is true or not. If that is not true I do: First I create a function tha

Re: Postgres SQLSTATE[08006] [7] timeout expired

2019-08-25 Thread Condor
On 25-08-2019 02:54, Adrian Klaver wrote: On 8/24/19 3:42 PM, Howard Wells wrote: I have three servers behind a load balancer and a fourth server solely for Postgres 10 database that is not behind the load balancer.  All four are behind the same firewall, with port 5432 open. I have a simple

Re: Format an Update with calculation

2018-12-19 Thread Condor
On 18-12-2018 15:51, Adrian Klaver wrote: On 12/17/18 11:14 PM, Bret Stern wrote: My statement below updates the pricing no problem, but I want it to be formatted with 2 dec points eg (43.23). Started playing with to_numeric but can't figure it out. Lots of examples with to_char in the manual

Re: Reg: Query for DB growth size

2018-11-29 Thread Condor
On 29-11-2018 08:41, R.R. PRAVEEN RAJA wrote: Hi All, Can i get the query or steps for how to check the Database growth in postgres. Thanks in advance. Regards, Praveen No official thing that can do the job. You need to DIY, start collecting data (database size, connections count, index

Re: Question about index on different tablespace and rebuild it

2018-11-25 Thread Condor
On 16-11-2018 19:40, Alexey Bashtanov wrote: Yes, I know. My question is: Did the pg server will start at all if the NVME / table space somehow is broken and indexes is unable to be loaded, not how to drop an index. Since the Postgre server is not starting at all maybe I can try dropping my ind

Re: Question about index on different tablespace and rebuild it

2018-11-07 Thread Condor
a few indexes to move, you could use (for example) pgadmin4 to generate and run stop/start scripts. Data in the index is stored separately from the table, dropping indexes in any of SQL standard databases doesn't affect the data in the tables. On Tue, 6 Nov 2018 at 21:49, Condor wrote:

Re: Question about index on different tablespace and rebuild it

2018-11-06 Thread Condor
On 05-11-2018 10:56, Condor wrote: Hello, I have a database that use index on different table space (nvme). I read documentation about table space and understand table space cannot be treated as an autonomous collection of data files. My question is: Is this always true ? I mean if I have table

Question about index on different tablespace and rebuild it

2018-11-05 Thread Condor
Hello, I have a database that use index on different table space (nvme). I read documentation about table space and understand table space cannot be treated as an autonomous collection of data files. My question is: Is this always true ? I mean if I have table .. okay here is example: crea

Re: Best way to select a random row from a derived table

2018-01-28 Thread Condor
On 28-01-2018 08:39, Ryan Murphy wrote: Hello hackers and postgressers, I am aware of 2 ways to select a random row from a table: 1) select * from table_name order by random() limit 1; -- terribly inefficient 2) select * from table_name tablesample system_rows(1) limit 1;

Re: PGSQL 10, many Random named DB

2018-01-24 Thread Condor
On 24-01-2018 12:52, Durumdara wrote: Hello! Somewhere the system administrator (who don't know the PG really) installed a PGSQL server (10.x) with a database. He couldn't manage the server well. Yesterday my colleague saw 21 databases in this server with random names. He checked it with built