Re: Question about password character in ECPG's connection string

2019-08-31 Thread Tom Lane
Luca Ferrari writes: > On Thu, Aug 29, 2019 at 1:08 PM Egashira, Yusuke > wrote: >> According to my tests, I think that the ECPG's connection_option seems not >> to accept '&' character as password anyhow... >> ECPG CONNECT's connection_option seems to have some restricted characters. > As far

Re: echo work alike in SQL

2019-08-31 Thread Pavel Stehule
Hi so 31. 8. 2019 v 17:46 odesílatel stan napsal: > Just started using the RAISE functionality to help in debugging. > > Tried to add it to an SQL script, only to realize it is a PLPGSQL > extension. > > Is there a way to get a string to appear in the output f an SQL script? > > Can I do some so

echo work alike in SQL

2019-08-31 Thread stan
Just started using the RAISE functionality to help in debugging. Tried to add it to an SQL script, only to realize it is a PLPGSQL extension. Is there a way to get a string to appear in the output f an SQL script? Can I do some sort of select? -- "They that would give up essential liberty for

Re: Problems with using function input paramaters

2019-08-31 Thread Tom Lane
"David G. Johnston" writes: > On Sat, Aug 31, 2019 at 7:05 AM stan wrote: >> CURRENT_DATE) - interval ' $1 >> month - 1 >> ' day as date) > ($1 || ' month')::interval -- should work FWIW, I tend to prefer doing it with interval arithmetic, like this: $1 * '1 month'::interval - '1 day'::inter

Re: Problems with using function input paramaters

2019-08-31 Thread David G. Johnston
On Sat, Aug 31, 2019 at 7:05 AM stan wrote: > > CURRENT_DATE) - interval ' $1 > month - 1 > ' day as date) > ($1 || ' month')::interval -- should work Content within a literal (i.e., between single quotes) is always treated as li

Re: Aggregate functions on groups

2019-08-31 Thread Rich Shepard
On Sat, 31 Aug 2019, Morris de Oryx wrote: Your tributaries and fish master tables make sense. If I read your code right, you're grouping by too many columns. I flattened the data into a survey table for this simple example: Morris, I'm still learning about postgres groups. My approach is to

Re: Problems with using function input paramaters

2019-08-31 Thread stan
On Sat, Aug 31, 2019 at 10:05:10AM -0400, stan wrote: > I have been chasing a bug for a bit now. I even wound up completely rewriting > the > function, which in the end turns out to be a good thing, as it is much > cleaner and > easy to read. > > I now believe that the bug is in how I am using

Problems with using function input paramaters

2019-08-31 Thread stan
I have been chasing a bug for a bit now. I even wound up completely rewriting the function, which in the end turns out to be a good thing, as it is much cleaner and easy to read. I now believe that the bug is in how I am using an input parameter to the function. Here is the function deceleratio

Re: SQL equivalint of #incude directive ?

2019-08-31 Thread Francisco Olarte
Stan: On Fri, Aug 30, 2019 at 3:49 PM stan wrote: ... > I am defining a bunch of functions, and I would prefer to store them in a > separate file, which then gets "source" by the main DB init file. > Is there a standard way to do this? I assume you mean "standard for postgres", AFAIK there is n