Re: Finding error in long input file

2024-07-10 Thread Hans Schou
On Wed, Jul 10, 2024 at 2:59 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > > And what are the first few lines of the file? Use text, not screenshots. > Yes the line with 'INSERT' grep -ni 'INSERT INTO' scripts/insert-addrs.sql -- 핳햆햓햘 핾했햍햔햚 ☏ ➁➁ ➅➃ ➇⓪ ➁⓪

Re: Finding error in long input file

2024-07-10 Thread Hans Schou
If the file has these line breaks you show, then can make it to multiple 'INSERT INTO' instead. Search for lines starting with parentese begin '(' and replace it with the correct INSERT and last comma to semi-colon: cat i.sql | sed -e 's/^(/INSERT INTO foo VALUES(/' -e 's/,$/;/' Does the file

Oracle Linux 9 Detected RPMs with RSA/SHA1 signature

2024-06-12 Thread Hans Schou
Hi On my test server I have Oracle Linux 8.10 installed. Here I have installed postgresql 16.1 from postgresql.org repository. Upgrade to Oracle Linux 9: When doing a »leapp preupgrade --oraclelinux« I get the message below. I want to have postgresql.org as my repo for PostgreSQL and Oracle

Re: utf8 vs UTF-8

2024-05-17 Thread Hans Schou
> test3 | troels | UTF8 | libc| en_US.utf8 | en_US.utf8 It is wrong but I guess it's working? how did you create test3? On Fri, May 17, 2024 at 2:44 PM Troels Arvin wrote: > Hello, > > In a Postgres installation, I have databases where the locale is > slightly

Re: Password forgotten

2024-04-23 Thread Hans Schou
Have you tried sudo -u postgres psql On Tue, Apr 23, 2024 at 2:14 PM Arbol One wrote: > Hello. > In my Debian box, after entering this command to psql-16, *psql -h > localhost -U postgres* > > psql-16 asks for the password, which I have forgotten. > So I get this message: > > > > *psql:

Re: Feature request: pg_get_tabledef(text)

2024-03-31 Thread Hans Schou
On Wed, Nov 22, 2023 at 5:09 PM Laurenz Albe wrote: > > One of the problems is what should be included. > Indexes? Policies? Constraints? > A high limit could be all objects except data. All the objects which would be deleted by a 'DROP TABLE'. Maybe including 'CASCADE'? No unsurmountable

Re: Trainning and Certification

2023-12-06 Thread Hans Schou
On Wed, Dec 6, 2023 at 3:39 PM roger popa wrote: > You can tell if exists an oficial Postgresql Certification issued by > postgresql.org ? > No. > Or others (like PearsonVue)? > EnterpriseDB has certifications. I think you can get some of them for free.

Feature request: pg_get_tabledef(text)

2023-11-22 Thread Hans Schou
Hi Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful with a pg_get_tabledef() to get a full description of how a table is defined. Currently the table definition can be extracted with the command: pg_dump -d foo --schema-only --table=bar | egrep '^[^-]' The psql command

Re: backing up the data from a single table?

2019-09-13 Thread Hans Schou
On Fri, Sep 13, 2019 at 4:14 PM stan wrote: > Is there a way to "export" a single table, that can be easily re > "imported"? > Export: pg_dump --table=foo > foo.sql Import: cat foo.sql | psql

Re: Memory settings

2019-06-30 Thread Hans Schou
Try run postgresqltuner.pl as suggested on https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server and also look at the other info there. After running a few days with live data run cache_hit_ratio.sql by Melvin Davidson: SELECT pg_stat_database.datname, pg_stat_database.blks_read,

Re: software or hardware RAID?

2019-03-23 Thread Hans Schou
On Sun, Mar 17, 2019 at 11:54 PM Rory Campbell-Lange < r...@campbell-lange.net> wrote: > We aren't sure whether to use software MDRaid or a MegaRAID card. > Never go with hardRaid. I have had a breakdown on a hardware RAID and as it was special and not off-the-shelf, I could not move the disk

Re: Installing PostgreSQL on Oracle Solaris

2019-03-23 Thread Hans Schou
On Sat, Mar 23, 2019 at 3:48 PM Igor Korot wrote: > > You mean even running as "sudo"? > igor@solaris:/usr$ sudo bunzip2 < postgresql-9.6.1-S11.i386-64.tar.bz2 | tar xpf - No, you are not running tar as sudo. I would at least suggest: cd /usr/local/src sudo tar --bzip2 xf

Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2

2019-02-16 Thread Hans Schou
On Fri, Feb 15, 2019 at 1:34 AM Bruce Klein wrote: > > If you are running Postgres inside Microsoft WSL > https://docs.microsoft.com/en-us/windows/wsl/faq Who is WSL for? This is primarily a tool for developers ... --- One problem with WSL is that the I/O performance is not

Re: What is the tuplestore?

2018-12-10 Thread Hans Schou
When one get a "No space left on device" and there is a lot of space it is sometimes caused by lack of inodes. Try run the command: df --inodes On Mon, Dec 10, 2018 at 4:56 PM Ron wrote: > Hi, > > v9.6.6 > > > 2018-12-07 06:21:55.504 EST 10.140.181.89(35868) CDS CDSLBXW 13748 SELECT >

Re: Swap on postgres master server

2018-10-16 Thread Hans Schou
Are you sure that swap is used actively? Maybe it had just been used during backup or something. Look after SwapIn/SwapOut (si/so) it should be '0' $ vmstat 1 procs ---memory-- ---swap-- -io -system-- --cpu- r b swpd free buff cache si sobibo

Re: Shared buffers increased but cache hit ratio is still 85%

2018-07-18 Thread Hans Schou
On Wed, Jul 18, 2018 at 10:44 AM Andreas Kretschmer wrote: > > ||pg_stat_reset() > Thanks, I guess we can see the result in a few days. BTW, strang command: it only reset current database and it can't take db as parameter.

Shared buffers increased but cache hit ratio is still 85%

2018-07-18 Thread Hans Schou
Hi I have this system with some databases and I have run the cache_hit_ratio.sql script on it. It showed that the db acme777booking had a ratio on 85%. I then changed shared_buffer size from 0.5GB to 4GB as the server has 16GB of physical RAM. After 6 days of running I checked the ratio again and

Re: Load data from a csv file without using COPY

2018-06-19 Thread Hans Schou
On Tue, Jun 19, 2018 at 10:17 PM Ravi Krishna wrote: > In order to test a real life scenario (and use it for benchmarking) I want > to load large number of data from csv files. > The requirement is that the load should happen like an application writing > to the database ( that is, no COPY

Grant to a group defined in Windows AD

2018-04-10 Thread Hans Schou
Hi Can I have a advise on how to handle groups? In my Windows AD (Active Directory) I have two groups named: readers writers In Postgresql I have these databases: d1 d2 The "writers" should have NOCREATEDB etc but ALL PRIVILEGES to d1 and d2. The "readers" should have SELECT to all

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:44 AM, Tom Lane wrote: > > The query does fail on < 9.2, because on rows with no reltoastrelid > Thats, fine. I will live with that until upgrade. > But hey, it's a wiki; > if you feel more ambitious, edit away. > I tried but it said: "The site

Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-15 Thread Hans Schou
On Thu, Mar 15, 2018 at 12:32 AM, Michael Paquier wrote: > > I'm running version 9.1.9 so it should be working according to the > > wiki. > > You should update and upgrade. 9.1 has fallen out of community support > I will recommend that to the database owner. Thanks

wiki Disk Usage, table size: ERROR: could not open relation with OID 0

2018-03-14 Thread Hans Schou
Hi I got the message ERROR: could not open relation with OID 0 when running the "General Table Size Information" from https://wiki.postgresql.org/wiki/Disk_Usage This patch gives some system tables @@ -12,5 +12,6 @@ FROM pg_class c LEFT JOIN pg_namespace n ON n.oid =

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-22 Thread Hans Schou
2017-12-21 21:50 GMT+01:00 Rakesh Kumar : > whenever SQLERROR EXIT ROLLBACK > Thanks. You are absolutely right. After starting with: WHENEVER SQLERROR EXIT ROLLBACK the process getting the deadlock will exit to command prompt (with %ERRORLEVEL% = 0). So what actually

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 12:41 GMT+01:00 Rakesh Kumar : > Could it be that the tool you are using in Oracle is doing commit while > exiting out due to Deadlock, because there is no explicit rollback. > The tool Im using is "sqlplus". By default you are always in a transaction and

Re: Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
2017-12-21 17:46 GMT+01:00 Jeremy Finzel : > It's hard to follow how the 2 videos relate, because you don't run the > same SQL both places. You first update where i = 2 in Postgres and i = 1 > in Oracle. > Well OK. I made a new one for PostgreSQL: https://youtu.be/En8EFv90yCc

Deadlock with one table - PostgreSQL is doing it right

2017-12-21 Thread Hans Schou
Hi FYI - if it has any interest During my preparation for describing what happens when two processes update the same row in a table, I came across that PostgreSQL is doing right and Oracle is doing it wrong. The situation is a process which get a deadlock, but because it is a script, it sends a