Re: Updating 457 rows in a table

2024-05-19 Thread Ray O'Donnell
On 19/05/2024 17:54, Rich Shepard wrote: Searching the postgresql doc for UPDATE the examples I find show updating one or a few rows in a table. I have 457 rows to update in a table. I could write a .sql script with 457 lines, each updating one row of the table. My web search for `sql: update

Re: Left join syntax error

2024-05-18 Thread Ray O'Donnell
On 18/05/2024 16:01, Rich Shepard wrote: On Sat, 18 May 2024, Ray O'Donnell wrote: You need to include the alias for the table also - see "...from companies as c..." in Shammat's example. Ray, That didn't work: bustrac-# FROM people as p, companies as c bustrac-# LEFT JOIN comp

Re: Left join syntax error

2024-05-18 Thread Ray O'Donnell
On 18/05/2024 15:46, Rich Shepard wrote: On Sat, 18 May 2024, Shammat wrote: Don't put the second table in the FROM part SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name FROM people as p  LEFT JOIN companies as c ON c.company_nbr = p.company_nbr Shammat, I

Re: Windows service randomly stops with no indication why

2024-03-08 Thread Ray O'Donnell
On 08/03/2024 14:17, Jay Madren wrote: Running PostgreSQL 15.6 on Windows Server 2022. The database service randomly just stops and the Windows Service auto-restart options don't kick in. The stop is unexpected (not a controlled shut down) because after restarting the service the postgresql

Re: Testing - Please ignore/delete this message

2024-01-02 Thread Ray O'Donnell
On 02/01/2024 13:12, Arbol One wrote: Did it work? No idea - I ignored it...! :-) Ray. -- Raymond O'Donnell // Galway // Ireland r...@rodonnell.ie

Re: pgBackRest on old installation

2023-11-21 Thread Ray O'Donnell
On 21/11/2023 11:59, Achilleas Mantzios - cloud wrote: On 11/21/23 08:36, KK CHN wrote: Thank you.  Its worked out well. But a basic doubt ? is storing the DB superuser password in .pgpass is advisable ? What other options do we have ? The .pgpass file is stored in the user's home

Re: Question about the new PostgreSQL 16 availability on Ubuntu

2023-10-25 Thread Ray O'Donnell
On 25/10/2023 16:47, John W Higgins wrote: As to the wiki (and/or any other references), small number of people, doing way too many things - some stuff doesn't get updated as quickly as one would like. ...not to mention that they are volunteers, doing it gratis in their own limited free

Re: Ubuntu 18 + PHP 8.2 + PDO: can't find drivers

2023-09-24 Thread Ray O'Donnell
On 23/09/2023 19:56, Chris Kelly wrote: On Ubuntu "18.04.6 LTS (Bionic Beaver)": # apt-cache search pgsql | grep 8 pike7.8-pg - PostgreSQL modules for Pike pike8.0-pg - PostgreSQL modules for Pike # apt-cache search pgsql | grep php php-pgsql - PostgreSQL module for PHP [default] php7.2-pgsql

Re: Ubuntu 18 + PHP 8.2 + PDO: can't find drivers

2023-09-22 Thread Ray O'Donnell
On 22 September 2023 21:40:38 Chris Kelly wrote: The need has mostly passed (I used another computer with Ubuntu 20) but are there clear, *working* instructions for how to connect to Postgress on Ubuntu 18 via PDO? I don't see drivers that would work. This is for a Drupal site. PS -

Re: Ubuntu 18 + PHP 8.2 + PDO: can't find drivers

2023-09-22 Thread Ray O'Donnell
On 22 September 2023 21:40:38 Chris Kelly wrote: The need has mostly passed (I used another computer with Ubuntu 20) but are there clear, *working* instructions for how to connect to Postgress on Ubuntu 18 via PDO? I don't see drivers that would work. This is for a Drupal site. From

Re: Upgrade problem

2023-09-11 Thread Ray O'Donnell
On 11/09/2023 17:33, Graeme wrote: On 11/09/2023 17:13, Adrian Klaver wrote: On 9/11/23 09:04, Graeme wrote: Preparing to upgrade my small cluster from Mageia 8/Pg 9 to Mageia 9/Pg 15. I'm at the point of running pg_upgrade but have received anerror message: You are going to have to be more

Re: Creating a TABLESPACE

2023-08-16 Thread Ray O'Donnell
On 16/08/2023 21:24, Ron wrote: Speakers of English as a second language are to be tolerated and assisted, not mocked and insulted. +1 I actually found it rather amusing. :-) Ray. On 8/16/23 12:27, Amn Ojee Uw wrote: Sorry, did not mean it that way. Thanks for the advice. On 8/16/23

Re: syntax pb

2023-05-30 Thread Ray O'Donnell
On 30/05/2023 14:45, Marc Millas wrote: and , now, if I want to insert that: Insert into t2 (a, b, c, d) Select distinct test1.t, 'abc' as b, NULL as c, NULL as d From t1 test1; I get: ERROR:  column "d" is of type numeric but expression is of type text LINE 2: Select distinct test1.t, 'abc'

Re: Converting row elements into a arrays?

2023-03-02 Thread Ray O'Donnell
On 02/03/2023 21:01, Ray O'Donnell wrote: On 02/03/2023 20:58, Ron wrote: Postgresql 12.13 Given the sample below, I'm looking for how to generate this output. It's like GROUP BY, but generating an array instead of an aggreate number.   f1 | f2_array +- 1 | {1,2,3}    2

Re: Converting row elements into a arrays?

2023-03-02 Thread Ray O'Donnell
On 02/03/2023 20:58, Ron wrote: Postgresql 12.13 Given the sample below, I'm looking for how to generate this output. It's like GROUP BY, but generating an array instead of an aggreate number.  f1 | f2_array +- 1 | {1,2,3}   2 | {1,2,3,4}   3 | {1,2} Something like this (off

Re: posgres question / answer

2022-12-01 Thread Ray O'Donnell
On 30/11/2022 22:39, Rizwan Shaukat wrote: Hi Team, im new to postgres, trying to learn postgres n i hv many questions in my mind, need to discuss in community, pls add access for questions. Hi there, This is a mailing list - emails to it go to everyone on the list. Ask away! Ray. --

Re: restore question

2022-07-19 Thread Ray O'Donnell
On 19/07/2022 11:11, Ronald Haynes wrote: Hi folks,  I am a fairly novice postgresql user. I have a backup file for a couple of small postgresql databases.    The backup file was created using postgresql 12.2, my Mac now has a postgresql 13.x or 14.x versions.   I would like to restore the

Re: Get the table creation DDL

2022-07-10 Thread Ray O'Donnell
On 10/07/2022 17:47, Igor Korot wrote: Hi, Michael, On Sun, Jul 10, 2022 at 11:13 AM Michael Nolan wrote: On Sun, Jul 10, 2022 at 10:28 AM Igor Korot wrote: Hi, Is there a query I can execute that will give me CREATE TABLE() command used to create a table? So there is no "query" per

Re: PostgreSQL 12.2 on Linux ubuntu 20.4 / s390

2022-06-15 Thread Ray O'Donnell
On 15/06/2022 11:58, Ian Dauncey wrote: According to the apt list for PostgreSQL there is nothing for the s390 system for version 13 and 14. That is more than likely your answer, so I'm not knowledgable on these things, but perhaps the packagers will be able to say more. I'd be guided by

Re: PostgreSQL 12.2 on Linux ubuntu 20.4 / s390

2022-06-15 Thread Ray O'Donnell
On 15 June 2022 08:31:42 Ian Dauncey wrote: Morning all Currently we are running PostgreSQL 12.2 on Ubuntu 20.04.1 LTS (Kernel: Linux 5.4.0-42-generic - Architecture: s390x). We are looking at upgrading to a later version of PostgreSQL My question is :- What is the latest available

Re: newbie db design question

2022-06-11 Thread Ray O'Donnell
On 11 June 2022 08:05:41 Rino Mardo wrote: hello! really noob question here. i have this experimental database design: create table products ( product_id serial primary key, description text, supplier_id) ; create table supplier ( supplier_id serial primary key, description text) ; the

Re: Problem with PG 11 database on OrangePi3 (ARMBIAN, ARM64) after disk disrupion (problem with USB disk connection)

2022-04-06 Thread Ray O'Donnell
On 06/04/2022 18:20, Laura Smith wrote: On Wednesday, April 6th, 2022 at 17:41, W.P. wrote: That was not a "command". PG was working ok, DB on encrypted (LUKS on LVM2, ext4) USB drive. I mean, why ? If there was ever a "setting yourself up to fail" scenario, it would be this. Just because

Re: Robust ways for checking allowed values in a column

2022-01-25 Thread Ray O'Donnell
On 25/01/2022 13:55, Shaozhong SHI wrote: I tried the following: select form from mytable where form ~ '^Canal$|^Drain$|^Foreshore$|^inlandRiver$|^Lake$|^lockOrFlightOfLocks$|^Marsh$|^Researvoir$|^Sea$|^tidalRiver$|^Transfer$' I used ^ and $ to ensure checking of allowed values. However,

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 12:51, Flaviu2 wrote: Yes, I ran *\c mydb1* but I didn't see any SQL script underhood :( Ah, OK. As I understand it, connecting to a database isn't something you can do in SQL: it's a function of the client, and how you do it depends on the client. - So in psql, it's a

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 12:42, Flaviu2 wrote: Yes, I started psql with -E, and now I see the SQL underhood. Thank you. Now I need to find how to get and how to select a specific database, I have no experience in Postgre SQL. Well, connecting from the command line with psql, you just specify it:

Re: List all tables from a specific database

2022-01-14 Thread Ray O'Donnell
On 14/01/2022 10:39, Flaviu2 wrote: I work on a project that use Postgre SQL, and I have 0 experience in this regard. I hope to get help here. I need two SQL scripts for Postgre: 1. Get all databases, which I aquired already: *SELECT datname FROM pg_database WHERE datistemplate = false* This

Re: Can we use sql language to create a function in Postgres?

2022-01-05 Thread Ray O'Donnell
On 05/01/2022 11:08, Ray O'Donnell wrote: On 05/01/2022 11:04, Shaozhong SHI wrote: I was given an Oracle script.  Can we use sql language to create a function in Postgres? Yes, absolutely: create function my_function(...) as $$   select. $$ language sql; Should have added the link

Re: Can we use sql language to create a function in Postgres?

2022-01-05 Thread Ray O'Donnell
On 05/01/2022 11:04, Shaozhong SHI wrote: I was given an Oracle script.  Can we use sql language to create a function in Postgres? Yes, absolutely: create function my_function(...) as $$ select. $$ language sql; Is this what you mean? Ray. -- Raymond O'Donnell // Galway // Ireland

Re: How best to turn select result into options like 'a|b|c''

2021-12-20 Thread Ray O'Donnell
On 20 December 2021 22:10:19 Shaozhong SHI wrote: Is there a way to turn select result into something like 'a|b|c' . Regards, David On my phone so hard to reply properly, but if a, b and c are in separate rows then you need the array_agg() and array_to_string() functions. Ray.

Re: How is JSON stored in PG ?

2021-11-16 Thread Ray O'Donnell
On 16/11/2021 15:54, David Gauthier wrote: Pros and Cons for using JSON ? If it helps, here's my current use-case. I'm currently working on a project wherein data is captured from students for eventual submission to the relevant government department. The exact set of data required changes

Re: Pg_hba.conf problem after unexpected IP change

2021-11-14 Thread Ray O'Donnell
On 14/11/2021 20:16, Adrian Klaver wrote: Actually that was already done: https://www.postgresql.org/message-id/CAOR%2BmccGARtFsb7c%2BF%3DRUk832%3DdaaJ8%2ByQW8eBYa1Krypr4O6Q%40mail.gmail.com The problems seems to have stemmed from this(per OP): "Well, it turns out that at one point when I

Re: Pg_hba.conf problem after unexpected IP change

2021-11-14 Thread Ray O'Donnell
On 14/11/2021 19:46, Yessica Brinkmann wrote: Hello. Thank you very much for your answer. The configuration actually works for me.After restarting my computer, I went to test again and it was already working. I assume that perhaps because they are virtual machines it was not only enough to

Re: Get COUNT results from two different columns

2021-09-23 Thread Ray O'Donnell
On 23/09/2021 14:37, Clive Swan wrote: Greetings, I have two separate queries that work individually, returning a count from each column. I want to subtract New(COUNT) from Old(Count) I get an error when trying to run UNION? At a quick guess, you'll need to move the subtraction outside

Re: database design with temporary tables

2021-08-29 Thread Ray O'Donnell
On 29/08/2021 17:53, Adrian Klaver wrote: On 8/29/21 9:38 AM, ourdiaspora wrote: ‐‐‐ Original Message ‐‐‐ On Sunday, August 29th, 2021 at 5:30 PM, Adrian Klaver wrote: On 8/29/21 9:24 AM, Adrian Klaver wrote: Whoops, unfinished thought. What I was going to ask is: The above is

Re: database design with temporary tables

2021-08-29 Thread Ray O'Donnell
On 29/08/2021 17:36, ourdiaspora wrote: ‐‐‐ Original Message ‐‐‐ On Sunday, August 29th, 2021 at 5:24 PM, Adrian Klaver wrote: Presumably not. Temporary tables only live at most for the length of a session. It would be a really bad idea to hold sessions open for 24 hours. Is

Re: PHP: query with parameter for SET

2021-07-27 Thread Ray O'Donnell
On 27/07/2021 18:20, Pavel Stehule wrote: When you use client side prepared statements, then it can be possible. But I don't know how it works in PHP. Server side prepared statements are not possible in this case. "set" statement has not execution plan. But you  You can use Adrian's

PHP: query with parameter for SET

2021-07-27 Thread Ray O'Donnell
Hi everyone, Using PHP (or indeed maybe more generally), is it possible to issue a SET TIME ZONE statement with a parameter for the new runtime setting? In a PHP application I'm issuing a SET TIME ZONE command just after the database connection is created, and for security I'd like to pass

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 03/07/2021 21:13, Adrian Klaver wrote: On 7/3/21 12:16 PM, Ray O'Donnell wrote: Yes, you're right - I realised that after I sent my last email. The inner loop in the function should have matched overlapping bookings by aircraft registration: -- For each booking, check whether

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 03/07/2021 18:59, Adrian Klaver wrote: I'm not sure this is doing what you think it is; [...]  select * from get_visible_bookings();  booking_id | aircraft_reg | type_code | booking_time | owner_uid | owner_name

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 27/06/2021 23:41, Ray O'Donnell wrote: Hi all, I'm playing with timestamptz ranges for a hobby project. I have a table with a tstzrange column, in which the timestamps can overlap; where they do, rows with a higher priority (derived from a bigint primary key column) should be picked. What

Re: Overlapping timestamptz ranges with priority

2021-07-03 Thread Ray O'Donnell
On 29/06/2021 22:49, Adrian Klaver wrote: If I'm following correctly then: 1) Under old system there where preset two hour slots over a day period, where the period was say 8:00 to 16:00 2) You now want to allow user defined two hour slots over the same period, where a slot can't start

Re: Overlapping timestamptz ranges with priority

2021-06-29 Thread Ray O'Donnell
On 29/06/2021 22:10, Adrian Klaver wrote: The queued bookings are for a particular aircraft or a particular time slot? They're for an aircraft. On the old system, they could only be for a slot - so if someone had booked, say, a two-hour slot, then anyone queued behind them could only queue

Re: Overlapping timestamptz ranges with priority

2021-06-29 Thread Ray O'Donnell
On 29/06/2021 20:43, Adrian Klaver wrote: An ounce of prevention is worth a pound of cure: 1) Install btree_gist create extension btree_gist ; 2) create table bookings (     booking_id bigint not null,     aircraft_id integer,     booking_time_start timestamptz,     booking_time_end

Re: Overlapping timestamptz ranges with priority

2021-06-28 Thread Ray O'Donnell
On 28/06/2021 00:52, Adrian Klaver wrote: On 6/27/21 3:41 PM, Ray O'Donnell wrote: Here's a slightly simplified example: create table bookings ( booking_id bigint not null, booking_time tstzrange not null, constraint bookings_pk primary key (booking_id) ); It seems to me

Overlapping timestamptz ranges with priority

2021-06-27 Thread Ray O'Donnell
Hi all, I'm playing with timestamptz ranges for a hobby project. I have a table with a tstzrange column, in which the timestamps can overlap; where they do, rows with a higher priority (derived from a bigint primary key column) should be picked. What I'd like to do is present a view which

Re: pgTAP installation

2021-06-20 Thread Ray O'Donnell
On 20/06/2021 14:24, Vijaykumar Jain wrote: This was a wrong suggestion. sorry. i'll try to reproduce what resulted in functions not getting loaded in your case. ok i guess you have a typo there. the function name is *no_plan()*, but you called *noplan() * Aaaargh - you're

pgTAP installation

2021-06-20 Thread Ray O'Donnell
Hi all, I'm just tipping my toe into the water with pgTAP for the first time, and must be doing something wrong - I can't seem to get it working. I'm on Kubuntu Hirsute, and I've installed both PostgreSQL 13 and pgTAP from apt.postgresql.org: sudo apt install postgresql-13 sudo apt

Re: SELECT in VCHAR column for strings with TAB

2021-06-10 Thread Ray O'Donnell
On 10/06/2021 14:30, Matthias Apitz wrote: Hello, I want to search in a VCHAR column for a string with two TAB at the end. I tried some things w/o any luck, like: select * from acq_vardata where name=concat('Test202112', 9, 9); select * from acq_vardata where name=concat('Test202112',

Re: Hello - About how to install PgAdmin4 on Debian 10

2021-03-27 Thread Ray O'Donnell
On 27/03/2021 14:59, Ray O'Donnell wrote: If you can, include the relevant bits from the pgAdmin log, which according to [2] should be here:  ~/.pgadmin/pgadmin4.log A quick find + grep also found me these: ~/.local/share/pgadmin4.startup.log ~/.local/share/pgadmin/pgadmin4/.pgAdmin4

Re: Hello - About how to install PgAdmin4 on Debian 10

2021-03-27 Thread Ray O'Donnell
Hello Carlos, This sounds like a different issue, and you would have more luck asking about it on the pgadmin-support list [1], which the developers follow. If you can, include the relevant bits from the pgAdmin log, which according to [2] should be here: ~/.pgadmin/pgadmin4.log Ray.

Re: Hello - About how to install PgAdmin4 on Debian 10

2021-03-24 Thread Ray O'Donnell
On 24/03/2021 20:17, Carlos Montenegro wrote: Yes Ray, I followed those instructions, but it seems the repository location changed. It is not available, but thank you so much for your support. It seems to be available for me: $ sudo apt update [] Hit:10

Re: Hello - About how to install PgAdmin4 on Debian 10

2021-03-24 Thread Ray O'Donnell
On 24/03/2021 19:08, Carlos Montenegro wrote: Hello dear Ray. Thanks for your answer. Yes, I see pgadmin4 and then tried, but any success. How did you make the installation? Any advice? Hi Carlos, I had forgotten - pgAdmin has its own apt repository, which you need to add:

Re: Hello - About how to install PgAdmin4 on Debian 10

2021-03-24 Thread Ray O'Donnell
On 24/03/2021 17:17, Carlos Montenegro wrote: Hello dear community. your help ! I am trying to install PgAdmin4 on Debian 10 following the instructions on here: https://wiki.postgresql.org/wiki/Apt but when execute: > sudo apt-get install pgadmin4 or

Re: Copy & Re-copy of DB

2021-01-21 Thread Ray O'Donnell
On 21/01/2021 13:13, sivapostg...@yahoo.com wrote: Hello, I'm from SQL Server now developing my current project using PG. In our earlier project(s), we used to copy the database from one server to another, work in another server, and re-copy it in the original server.   All happened easily

Re: format return of "age" to hh:mm

2020-03-05 Thread Ray O'Donnell
On 05/03/2020 15:50, David Gauthier wrote: > Hi: > > How does one reformat the output of the "age" function to always be in > terms of hours:mins. Hi there, age() returns an interval, so without having tried it I'm guessing you could use to_char() to format it whatever way you want. Ray. --

Re: Upgrade to 12.2 using same data directory

2020-02-25 Thread Ray O'Donnell
On 25/02/2020 12:52, Mihalidesová Jana wrote: > I think it’s strange to change the data directory $PATH every time I > upgrade the software, when the data are the same. I have a specific > naming convention not using a db version. There's a lot to recommend keeping an untouched copy of your old

Re: POLL: Adding transaction status to default psql prompt

2020-02-06 Thread Ray O'Donnell
On 06/02/2020 02:54, Vik Fearing wrote: > Hello, > > I proposed a patch to add %x to PROMPT1 and PROMPT2 by default in psql. > > The effect of this is: > > - nothing at all when not in a transaction, > - adding a '*' when in a transaction or a '!' when in an aborted > transaction. > > Before

Re: How to transfer databases form one server to other

2020-01-27 Thread Ray O'Donnell
On 27/01/2020 12:40, Andrus wrote: > Hi! > >>> Postgres version 12 pg_dump probably cannot installed in old server >>> (Debian Squeeze 9). > >> I have it installed on my Debian 9 laptop, from the PostgreSQL apt repo: > >>  https://apt.postgresql.org > > Oled server uses Debian Sqeeze whose

Re: How to transfer databases form one server to other

2020-01-27 Thread Ray O'Donnell
On 26/01/2020 22:47, Andrus wrote: > Hi! > >> Before you do any of this I would check the Release Notes for the >> first release of each major release. Prior to version 10 that would be >> X.X.x where X is a major release. For 10+ that is X.x.  I would also >> test the upgrade before doing it on

Re: What am I doing wrong here?

2019-12-26 Thread Ray O'Donnell
On 26/12/2019 13:36, stan wrote: > IF _bom_name_key is NULL > THEN > WITH inserted AS ( > INSERT into project_bom > (project_key, bom_name) > VALUES > (NEW.project_key , 'Main') >

Re: SELECT returnig a constant

2019-10-15 Thread Ray O'Donnell
On 15/10/2019 15:01, stan wrote: Thanks, as you can see from my SOLVED reply, I go that part figured out. Now I am trying to figure out how to complete this. The SELECT returns more than 1 row, and when I put that in the VALUES clause this does not work. Please reply to the list, rather than

Re: SELECT returnig a constant

2019-10-15 Thread Ray O'Donnell
On 15/10/2019 14:28, stan wrote: I used to be able to return a constant value in a SELECT statement in ORACLE. I need to populate a table for testing, and I was going to do so like this: SELECT employee.id , project.proj_no , work_type.type ,

Re: Phone number type extension

2019-09-28 Thread Ray O'Donnell
On 28/09/2019 11:13, Morris de Oryx wrote: For clarification, what do you mean by "phone number"? I'm not being dense, I'm wondering if you're looking for a type that handles only numbers from one country, or that can deal with the rules for a variety of countries. That was my first thought

Re: backing up the data from a single table?

2019-09-13 Thread Ray O'Donnell
On 13/09/2019 15:13, stan wrote: My development methodology is to create scripts that init the db, and load test data, as I make changes. Now, I am starting to move toward a test instance with real data. The end user has provided "real" test data, n spreadsheets. I have the inputing of data

Re: PGAdmin4.11.1 on Ubuntu 18.04

2019-08-01 Thread Ray O'Donnell
On 01/08/2019 16:32, Tony Shelver wrote: The article at stackoverflow is here Thanks for the link! The solution given in one of the comments there worked for me (Debian 9): - Install pip3 if needed:

Re: Why does the pg_dumpall command have a database option?

2019-06-21 Thread Ray O'Donnell
On 21/06/2019 14:32, Espresso Beanies wrote: Will it still dump all of the databases or just the one it connects to? On Thu, Jun 20, 2019 at 4:13 PM Adrian Klaver > wrote: On 6/20/19 1:03 PM, Espresso Beanies wrote: > I'm trying to see if someone

Re: Connection refused (0x0000274D/10061)

2019-06-09 Thread Ray O'Donnell
On 09/06/2019 20:49, Sourav Majumdar wrote: Hello, Thanks for your quick response. I am new to pgsql, didnot configured it , can you please give a guidance for that? I will be highly oblised if you can assist me. I am using windows 8.1, 64 bit. ruby 2.3.3p222 (2016-11-21 revision 56859)

Re: Connection refused (0x0000274D/10061)

2019-06-09 Thread Ray O'Donnell
On 09/06/2019 19:51, Sourav Majumdar wrote: could not connect to server: Connection refused (0x274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x274D/10061) Is the

Re: Converting yes or no to one letter strings.

2019-06-04 Thread Ray O'Donnell
On 4 June 2019 23:30:33 Lou wrote: Hi everyone, Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e' To start off, I just need to convert true to 's'. false will have to be manually changed to 'f' or 'p' or 'e' as

Re: duplicate key value violates unique constraint "chinese_price_infos_pkey"

2019-05-06 Thread Ray O'Donnell
On 06/05/2019 12:10, Arup Rakshit wrote: Hi, Thanks for your reply. It is automatic, my app don’t creates ID, it delegates it to the DB. I am using Ruby on Rails app, where we use Postgresql. Well, I'm only throwing out wild guesses, but another possibility is that rows were loaded manually

Re: duplicate key value violates unique constraint "chinese_price_infos_pkey"

2019-05-06 Thread Ray O'Donnell
On 06/05/2019 12:05, Arup Rakshit wrote: Every time I try to insert I get the error: docking_dev=# INSERT INTO "chinese_price_infos" ("item_code", "price_cents", "unit", "description", "company_id", "created_at", "updated_at") VALUES ('01GS10001', 6000, 'Lift', 'Shore Crane Rental',

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

2019-04-30 Thread Ray O'Donnell
On 30/04/2019 16:00, Andrew Gierth wrote: "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 Well, current_date is different: current_date

Re: Resetting identity columns

2019-04-23 Thread Ray O'Donnell
On 22/04/2019 18:49, Tom Lane wrote: "Ray O'Donnell" writes: In general, then, is it not possible to use an expression thus? - [...] ALTER COLUMN [...] RESTART WITH No. In general, PG's utility commands (everything except SELECT/ INSERT/UPDATE/DELETE) don't do

Re: Resetting identity columns

2019-04-22 Thread Ray O'Donnell
On 22/04/2019 17:02, Adrian Klaver wrote: do language plpgsql $$ declare m_max_id bigint; begin select max(id) + 1 from identity_test into m_max_id; EXECUTE 'alter table identity_test alter column id restart with ' || m_max_id; end; $$; Thanks a million Adrian - EXECUTE did the job, and I

Resetting identity columns

2019-04-22 Thread Ray O'Donnell
Hi all, I'm probably doing something silly I'm migrating data from one database table to another, where the old table used a SERIAL primary key and the new one uses GENERATED BY DEFAULT AS IDENTITY. Having loaded the data into the new table, I need to reset the underlying sequence so that

Re: Performance comparison between Pgsql 10.5 and Pgsql 11.2

2019-03-01 Thread Ray O'Donnell
On 01/03/2019 15:01, Nicola Contu wrote: Hello, is there any reason why I am getting worse results using pgsql11.2 in writing comparing it with pgsql 10.6? I have two Instances, both just restored, so no bloats. Running read queries I have pretty much same results, a little bit better on

Re: pgexpress 4.60 vita voom

2019-01-30 Thread Ray O'Donnell
On 30/01/2019 14:19, Ray O'Donnell wrote: On 30/01/2019 11:22, ceuro wrote: Hello everybody, this is my first post. I need to update to vita voom pgexpress 4.60 in order to upgrade to postgresql 9.2: I've tried to contact vita voom to collect (I've also already payed) the last release

Re: pgexpress 4.60 vita voom

2019-01-30 Thread Ray O'Donnell
On 30/01/2019 11:22, ceuro wrote: Hello everybody, this is my first post. I need to update to vita voom pgexpress 4.60 in order to upgrade to postgresql 9.2: I've tried to contact vita voom to collect (I've also already payed) the last release of the driver but nobody answer me: Is there anybody

Re: Multiple postgresql clusters with same version and separate binaries

2019-01-04 Thread Ray O'Donnell
On 04/01/2019 14:21, Erika Knihti-Van Driessche wrote: Hi, I have 10+ postgresql clusters (v 9.6) running on one machine - each having their own data directory and port. They all share same binaries though, and this is now giving me some headache.. I cannot shutdown all clusters at the same

Re: initialize and use variable in query

2018-12-29 Thread Ray O'Donnell
On 29/12/2018 15:40, Glenn Schultz wrote: All, I need to initialize a variable and then use it in query. Ultimately this will part of a recursive CTE but for now I just need to work this out.  I followed the docs and thought I needed something like this.  But does not work-maybe I have