Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> You might have better luck with "psql -n", or maybe not. > I've wished sometimes for a "\set READLINE off" psql metacommand for > this kind of thing. It's pretty annoying when the text being pasted > contains tabs and

Re: [GENERAL] Fastest memmove in C

2016-07-07 Thread FarjadFarid(ChkNet)
As the article demonstrated, performance of memove libraries is dependent on the size of memory copied and the hardware. Therefore it is both a software and hardware function. This post was simply put out here as something that might be of use. It is Ok if it is of no interest.

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Merlin Moncure wrote: > Might be a 'xterm vs Mate Terminal' problem. Using raw xterm > performance is great. I like some of the creature comforts of the > mate terminal though. Heh. I've been using lxterminal for a couple of weeks now and I find some of these comfort features rather

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread John R Pierce
On 7/7/2016 10:36 AM, Melvin Davidson wrote: It would help if you provided the version of PostgreSQL and the O/S. we still don't know what OS you're using here, and if its something like linux, what desktop environment you're using (gnome, kde, mate, etc) ? -- john r pierce, recycling

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Merlin Moncure
On Thu, Jul 7, 2016 at 2:48 PM, Alvaro Herrera wrote: > Merlin Moncure wrote: >> On Thu, Jul 7, 2016 at 1:18 PM, Alvaro Herrera >> wrote: >> > Tom Lane wrote: >> > >> >> You might have better luck with "psql -n", or maybe not. >> > >> > I've

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread John R Pierce
On 7/7/2016 12:48 PM, Alvaro Herrera wrote: Agreed. I've looked at this problem extensively and concur that >readline is the culprit; I don't think there's any solution on our end >besides filing a bug with the readline. I also agree with the >upthread suggestion that the best workaround today

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Merlin Moncure wrote: > On Thu, Jul 7, 2016 at 1:18 PM, Alvaro Herrera > wrote: > > Tom Lane wrote: > > > >> You might have better luck with "psql -n", or maybe not. > > > > I've wished sometimes for a "\set READLINE off" psql metacommand for > > this kind of thing.

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Merlin Moncure
On Thu, Jul 7, 2016 at 1:18 PM, Alvaro Herrera wrote: > Tom Lane wrote: > >> You might have better luck with "psql -n", or maybe not. > > I've wished sometimes for a "\set READLINE off" psql metacommand for > this kind of thing. It's pretty annoying when the text being

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Alvaro Herrera
Tom Lane wrote: > You might have better luck with "psql -n", or maybe not. I've wished sometimes for a "\set READLINE off" psql metacommand for this kind of thing. It's pretty annoying when the text being pasted contains tabs and readline uses to do completion. -- Álvaro Herrera

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Adrian Klaver
On 07/07/2016 10:41 AM, Dmitry Shalashov wrote: Have you also tried simplifying the sql for multiple values in one statement? this is another possible solution, but it's not answering my general "why is this happening" question. When I have seen this I put it down to encoding issues. It

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Rob Sargent
If, on the wild chance you're an emacs user, if the section is in a ".sql" buffer Ctrl-C Ctrl-B will send the entire buffer. Not sure if there's a practical limit on the number of line/statements, but I've used this with a couple of "pages" worth of sql. On 07/07/2016 11:48 AM, Dmitry

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
Oh sweet! Thanks! Dmitry Shalashov, surfingbird.ru & relap.io 2016-07-07 20:39 GMT+03:00 Scott Mead : > > > On Thu, Jul 7, 2016 at 1:30 PM, Dmitry Shalashov > wrote: > >> Hi Sameer, >> >> I am trying to copy-paste (and execute) random snippets of SQL to

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
> Have you looked at this line in the file- > INSERT INTO oko_topsites VALUES('russian_federation','calend.ru' in file it's perfectly fine. It's something that happens during paste brokes it. Dmitry Shalashov, surfingbird.ru & relap.io 2016-07-07 20:37 GMT+03:00 Sameer Kumar

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
> Yeah, I've noticed there's a limit on the amount you can paste into psql, > at least on some platforms. AFAICT this must be a readline > bug/limitation, or maybe something about the X cutbuffer protocol That would be sad... Actually if you don't know the answer then I suppose I can't do

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread John R Pierce
On 7/7/2016 10:30 AM, Dmitry Shalashov wrote: There is another ways to do it, which do not involve copy-paste, but I am wondering why is copy-paste won't work. What exactly is happening there... probably your OS's console terminal emulation is overrunning on the large paste. many moving

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
> Have you also tried simplifying the sql for multiple values in one statement? this is another possible solution, but it's not answering my general "why is this happening" question. This is happening with PostgreSQL 9.5.3 and psql 9.5.3, but actually I am seeing this for a few years... Since I

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Scott Mead
On Thu, Jul 7, 2016 at 1:39 PM, Scott Mead wrote: > > > On Thu, Jul 7, 2016 at 1:30 PM, Dmitry Shalashov > wrote: > >> Hi Sameer, >> >> I am trying to copy-paste (and execute) random snippets of SQL to psql >> console. >> >> There is another ways to do it,

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Scott Mead
On Thu, Jul 7, 2016 at 1:30 PM, Dmitry Shalashov wrote: > Hi Sameer, > > I am trying to copy-paste (and execute) random snippets of SQL to psql > console. > > There is another ways to do it, which do not involve copy-paste, but I am > wondering why is copy-paste won't work.

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Sameer Kumar
On Fri, Jul 8, 2016 at 1:31 AM Dmitry Shalashov wrote: > Hi Sameer, > > I am trying to copy-paste (and execute) random snippets of SQL to psql > console. > Why? Is it some migration of data? You are better off exporting the data to csv and use COPY command. > > There is

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Tom Lane
Dmitry Shalashov writes: > Let say that I have some sql file with like hundred of simple statements in > it. I `cat` it, copy it to buffer, go to my beloved psql and insert it > there. > But somewhere after first few lines it screws over: Yeah, I've noticed there's a limit on

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Melvin Davidson
On Thu, Jul 7, 2016 at 1:33 PM, Dmitry Shalashov wrote: > > *\i your_file_name* > > I actually mentioned this way in my original posting. In my case it would > involve copy-paste anyway - to create a file on a system where I have psql > opened. > I may do it that way. But why

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
> *\i your_file_name* I actually mentioned this way in my original posting. In my case it would involve copy-paste anyway - to create a file on a system where I have psql opened. I may do it that way. But why copy-paste directly to psql results in this behaviour? Dmitry Shalashov,

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
Hi Sameer, I am trying to copy-paste (and execute) random snippets of SQL to psql console. There is another ways to do it, which do not involve copy-paste, but I am wondering why is copy-paste won't work. What exactly is happening there... Dmitry Shalashov, surfingbird.ru & relap.io

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Melvin Davidson
This might seem a bit basic, but as long as you have a psql session, why not just use \i your_file_name On Thu, Jul 7, 2016 at 1:26 PM, Sameer Kumar wrote: > > > On Fri, 8 Jul 2016, 1:23 a.m. Dmitry Shalashov, wrote: > >> Hi everyone. >> >> Let say

Re: [GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Sameer Kumar
On Fri, 8 Jul 2016, 1:23 a.m. Dmitry Shalashov, wrote: > Hi everyone. > > Let say that I have some sql file with like hundred of simple statements > in it. I `cat` it, copy it to buffer, go to my beloved psql and insert it > there. > But somewhere after first few lines it

[GENERAL] pasting a lot of commands to psql

2016-07-07 Thread Dmitry Shalashov
Hi everyone. Let say that I have some sql file with like hundred of simple statements in it. I `cat` it, copy it to buffer, go to my beloved psql and insert it there. But somewhere after first few lines it screws over: b2b=> BEGIN; b2b=> INSERT INTO oko_topsites

Re: [GENERAL] Fastest memmove in C

2016-07-07 Thread Tom Lane
Stephen Frost writes: > While I agree with this, I'm trying to figure out why this isn't being > incorporated into glibc instead..? Indeed --- it seems far more useful to integrate this sort of work at the libc level than to ask applications to support their own replacements

Re: [GENERAL] Fastest memmove in C

2016-07-07 Thread Stephen Frost
* Merlin Moncure (mmonc...@gmail.com) wrote: > Well, testing is the key here. Microbechmarks demonstrating the value > are not enough; proven statistically relevant benchmarks generated > from postgres are the data points needed to make an assessment. My > recommendation would be to dynamically

Re: [GENERAL] Fastest memmove in C

2016-07-07 Thread Merlin Moncure
On Thu, Jul 7, 2016 at 6:12 AM, FarjadFarid(ChkNet) wrote: > > > Hi Álvaro, > > Based on the article. This research has been tested with various hardware. > The code automatically detects the hardware and based on the size of memory > to be copied it will choose

[GENERAL] Re: Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.

2016-07-07 Thread Thomas Kellerer
Silk Parrot schrieb am 07.07.2016 um 08:56: > Hi, > >I am trying to build a user database. The steps for creating a new user > are: > > 1. Use gen_salt to create a salt. > 2. Compute the hash based on the salt and password and store both the hash > and the salt into a new row. > > > The

Re: [GENERAL] Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.

2016-07-07 Thread David G. Johnston
On Thu, Jul 7, 2016 at 2:56 AM, Silk Parrot wrote: > Hi, > >I am trying to build a user database. The steps for creating a new user > are: > > 1. Use gen_salt to create a salt. > 2. Compute the hash based on the salt and password and store both the hash > and the salt

Re: [GENERAL] Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.

2016-07-07 Thread Sándor Daku
On 7 July 2016 at 08:56, Silk Parrot wrote: > Hi, > >I am trying to build a user database. The steps for creating a new user > are: > > 1. Use gen_salt to create a salt. > 2. Compute the hash based on the salt and password and store both the hash > and the salt into a

[GENERAL] Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.

2016-07-07 Thread Silk Parrot
Hi,      I am trying to build a user database. The steps for creating a new user are: 1. Use gen_salt to create a salt. 2. Compute the hash based on the salt and password and store both the hash and the salt into a new row. The pl/pgsql would look like this: CREATE OR REPLACE FUNCTION

Re: [GENERAL] Fastest memmove in C

2016-07-07 Thread FarjadFarid(ChkNet)
Hi Álvaro, Based on the article. This research has been tested with various hardware. The code automatically detects the hardware and based on the size of memory to be copied it will choose one of 3 routines. Regarding license I don't much problem with "Code Project Open License". Why not

Re: [GENERAL] Update statement results in Out of memory

2016-07-07 Thread Ivan Bianchi
Thanks for all for the good feedback, I realize that there's no problem with the configuration, and I assume that the full update statement is a bad decision by itself, so I made a batch process with single updates statements which commits every 50 single operation. What I can discover now is

Re: [GENERAL] Broken after upgrade

2016-07-07 Thread arnaud gaboury
On Thu, Jul 7, 2016 at 1:00 AM, José María Terry Jiménez wrote: > El 7/7/16 a las 0:14, Devrim Gündüz escribió: > >> Hi, >> >> Fedora packages have an executable (not sure about its name, but check a >> package called postgresql-upgrade or so). That will help you to finish the