Re: copy command - something not found

2020-12-29 Thread Susan Hurst
Tom...I think you are right about feeding the contents of the csv file to the shell instead of psql. After drilling down a bit more into my script, I now think I have a UNIX shell script problem rather than a psql problem. I do appreciate everyone's input as it has been most helpful in my

Re: copy command - something not found

2020-12-29 Thread Adrian Klaver
On 12/29/20 12:01 PM, Susan Hurst wrote: Actually, the -c was in an example of a copy command that I found while working at my last job. I tried executing the command without the -c and got the same results as before, so I suppose I really don't know what it means. Can you enlighten me? -c

Re: copy command - something not found

2020-12-29 Thread Christophe Pettus
> On Dec 29, 2020, at 11:12, Susan Hurst wrote: > > ##-- shell script command > psql -d ${DBNAME} -U ${DBNAME} -h ${HOSTNAME} -c < ${CSVPATH}copycmd.z The -c argument there specifies a command to run, so it needs an argument of some kind. It looks like ultimately the .csv file gets handed

Re: copy command - something not found

2020-12-29 Thread Igor Korot
Hi You could try to do "set +x" before running the script... Thank you. On Tue, Dec 29, 2020, 2:23 PM David G. Johnston wrote: > On Tue, Dec 29, 2020 at 1:01 PM Susan Hurst < > susan.hu...@brookhurstdata.com> wrote: > >> Actually, the -c was in an example of a copy command that I found while

Re: copy command - something not found

2020-12-29 Thread David G. Johnston
On Tue, Dec 29, 2020 at 1:01 PM Susan Hurst wrote: > Actually, the -c was in an example of a copy command that I found while > working at my last job. I tried executing the command without the -c and > got the same results as before, so I suppose I really don't know what it > means. > > Can you

Re: copy command - something not found

2020-12-29 Thread Susan Hurst
Actually, the -c was in an example of a copy command that I found while working at my last job. I tried executing the command without the -c and got the same results as before, so I suppose I really don't know what it means. Can you enlighten me? ---

Re: copy command - something not found

2020-12-29 Thread Susan Hurst
Thank you for the reminders, John. I changed my .z file extension to .tmp and removed the trailing / from my pre-defined directory path. I'm still getting the same results as before though after changing the .z file extension to .tmp. The ${DBNAME} and ${HOSTNAME} variables are input at run

Re: copy command - something not found

2020-12-29 Thread Tom Lane
Susan Hurst writes: > ##-- output from terminal window > /home/dbzone/stp/rfc_db/RFC-1/RFC-1_copy_bar_active.csv: > schema_name,table_name,table_alias: not found > /home/dbzone/stp/rfc_db/RFC-1/RFC-1_copy_bar_active.csv: > chief,source_systems,ssys: not found >

Re: Dynamic procedure execution

2020-12-29 Thread Adrian Klaver
On 12/29/20 9:29 AM, Mark Johnson wrote: Don't you have to select into a variable and then return the variable to the client per [1]? Except PROCEDUREs do not return things(INOUT excepted), it would need to be a FUNCTION. Consider the following example from my Oracle system: beginning

Re: copy command - something not found

2020-12-29 Thread David G. Johnston
On Tuesday, December 29, 2020, Susan Hurst wrote: > > ##-- shell script command > psql -c < ${CSVPATH}copycmd.z > Given the meaning of “-c” what are you expecting that to do? David J.

Re: copy command - something not found

2020-12-29 Thread John McKown
Can't really tell. You might want to post the output of the "printenv" command to show us what the shell variables you are using have in them. Oh, does ${CSVPATH} end in a slash? If it is something like "~/mycsvs" then ${CSVPATH}copycmd.z will expand to "~/mycsvscopycmd.z". Most "PATH"

copy command - something not found

2020-12-29 Thread Susan Hurst
I am trying to use the copy command from a csv files using a UNIX shell script but something is 'not found'...I can't figure out what is 'not found'. Below is my command from the shell script, the executed command, the content of the csv file and the output from trying to execute the command.

Re: Problem with ssl and psql in Postgresql 13

2020-12-29 Thread Tom Lane
I've got one last complaint about the backend GSS code: we are doing things randomly differently in the two places that install krb_server_keyfile as the active KRB5_KTNAME value. secure_open_gssapi() sets KRB5_KTNAME unconditionally (and doesn't bother to check for error, either, not a good

Re: Dynamic procedure execution

2020-12-29 Thread Mark Johnson
Don't you have to select into a variable and then return the variable to the client per [1]? Consider the following example from my Oracle system: beginning code ... V_SQL := 'SELECT COUNT(*) FROM ' || V_TAB; EXECUTE IMMEDIATE V_SQL INTO V_CNT; ending code ... [1]

Re: Dynamic procedure execution

2020-12-29 Thread Adrian Klaver
On 12/28/20 10:34 PM, Muthukumar.GK wrote: Pleas do not top post, the style on this list is bottom/inline posting. Hi Adrian Klaver, Sorry for typo mistake. Instead of writing lengthy query, I had written it simple. Actually my main concept is to bring result set with multiple rows (using

Re: SV: Problem with ssl and psql in Postgresql 13

2020-12-29 Thread Tom Lane
Svensson Peter writes: > Yes, libpq patch solved our problem. Thanks for confirming! I've pushed that patch and the server-side fixes, so it'll be in February's releases. regards, tom lane

SV: Problem with ssl and psql in Postgresql 13

2020-12-29 Thread Svensson Peter
Hi, Yes, libpq patch solved our problem. Before patch: psql -h myserver -U myuser -d postgres psql: error: FATAL: no pg_hba.conf entry for host "ip", user "myuser", database "postgres", SSL off FATAL: no pg_hba.conf entry for host "ip", user "myuser", database "postgres", SSL off With