Re: External psql editor

2022-05-02 Thread Reid Thompson
On Fri, 2022-04-29 at 13:21 -0700, Rich Shepard wrote: > On Fri, 29 Apr 2022, Reid Thompson wrote: > > > https://linuxgazette.net/issue14/bashtip.html  may of of use. > > Reid, > > I've had no issues using joe in any v.t. running an application > (e.g., > alpine) or by itself. Apparently, psql i

Re: External psql editor

2022-05-02 Thread Rich Shepard
On Mon, 2 May 2022, Reid Thompson wrote: Apparently, psql is different. I believe that psql also uses readline, so my thought was that maybe these instructions could enable you to map the 'move' keystrokes that you're familiar with to be used while on the psql command line. A very quick test

Re: Backing up a DB excluding certain tables

2022-05-02 Thread Adrian Klaver
On 5/2/22 12:24, JORGE MALDONADO wrote: Hi, After a lot of tests and reading about the issue with the "*exclude table*" option on *pg_dump*, I found many articles saying that the problem has to do with the encoding of the DB. The DB I am testing with has a *WIN1252* encoding, so I decided to

Re: External psql editor

2022-05-02 Thread Tom Lane
Rich Shepard writes: > On Mon, 2 May 2022, Reid Thompson wrote: >> I believe that psql also uses readline, so my thought was that maybe these >> instructions could enable you to map the 'move' keystrokes that you're >> familiar with to be used while on the psql command line. A very quick test >> s

Re: External psql editor

2022-05-02 Thread Rich Shepard
On Mon, 2 May 2022, Tom Lane wrote: Perhaps your psql is built against libedit rather than readline. Tom, Could be I use the SlackBuilds.org build script. Regards, Rich

UUID vs serial and currval('sequence_id')

2022-05-02 Thread Robert Stanford
Hi, When doing an insert with a serial primary key we can refer to currval('sequence_name') in subsequent inserts and we also return it for later processing. Example: CREATE TABLE contact ( contactid serial not null primary key, -- creates sequence 'contact_contactid_seq' firstname text n

Re: UUID vs serial and currval('sequence_id')

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 3:33 PM Robert Stanford wrote: > > --insert statement as single transaction returning contactid > INSERT INTO contact( > firstname, lastname) > VALUES('John', 'Smith'); > INSERT INTO contactinterests( > contactid, interest) > VALUES (currval('contact_contactid_s

Re: External psql editor

2022-05-02 Thread Mladen Gogala
On 5/2/22 17:27, Tom Lane wrote: Rich Shepard writes: On Mon, 2 May 2022, Reid Thompson wrote: I believe that psql also uses readline, so my thought was that maybe these instructions could enable you to map the 'move' keystrokes that you're familiar with to be used while on the psql command li

Re: UUID vs serial and currval('sequence_id')

2022-05-02 Thread Robert Stanford
On Tue, 3 May 2022 at 08:39, David G. Johnston wrote: > You basically have to use "INSERT ... RETURNING" or variables. Which/how > depends on the language you are writing in. Pure SQL without client > involvement requires that you use chained CTEs of INSERT...RETURNING (or I > suppose you could

Re: UUID vs serial and currval('sequence_id')

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 4:24 PM Robert Stanford wrote: > On Tue, 3 May 2022 at 08:39, David G. Johnston > wrote: > >> You basically have to use "INSERT ... RETURNING" or variables. Which/how >> depends on the language you are writing in. Pure SQL without client >> involvement requires that you

Re: External psql editor

2022-05-02 Thread Steve Litt
Tom Lane said on Mon, 02 May 2022 17:27:15 -0400 >Rich Shepard writes: >> On Mon, 2 May 2022, Reid Thompson wrote: >>> I believe that psql also uses readline, so my thought was that >>> maybe these instructions could enable you to map the 'move' >>> keystrokes that you're familiar with to be us

Re: External psql editor

2022-05-02 Thread Peter J. Holzer
On 2022-05-03 01:49:41 -0400, Steve Litt wrote: > Tom Lane said on Mon, 02 May 2022 17:27:15 -0400 [changing keybindings doesn't work] > >Perhaps your psql is built against libedit rather than readline. > > If this is indeed true, he can give his psql readline capabilities by > installing rlwrap