[GENERAL] Extract giving wrong week of year

2015-09-25 Thread Ben Primrose
All, I’m seeing some odd behavior from the extract function. Any idea why extract would think January 3rd of next year is the 53rd week of the year? Thanks Ben [bprimrose@primrose partitioning]$ psql Null display is "¤". Line style is unicode. Output format is wrapped. Tim

Re: [GENERAL] Extract giving wrong week of year

2015-09-28 Thread Ben Primrose
5:01 PM To: Ben Primrose Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Extract giving wrong week of year Ben Primrose writes: > I’m seeing some odd behavior from the extract function. > Any idea why extract would think January 3rd of next year is the 53rd > wee

Re: [GENERAL] CTE and function

2016-02-25 Thread Ben Primrose
This is my understanding, hopefully someone will chime in if I'm off. Using EXECUTE, the SQL is executed in a separate context than the current statement. So it's checking for a table with the name you pass, not aliases within the current statement. Giving the function another parameter to allow