Re: [SQL] Week to date function

2010-03-27 Thread Jorge Godoy
s they start on Monday. In Portuguese, the word for Monday can also be translated as "Second", as in "Second day". How to say that the second day is in fact the first? :-) -- Jorge Godoy On Sat, Mar 27, 2010 at 18:31, Hiltibidal, Rob < rob.hiltibi...@argushealth.com>

Re: [SQL] Week to date function

2010-03-27 Thread Jorge Godoy
re is no week 00). 28 December is always in the last week of its year. The week number can be described by counting the Thursdays: week 12 contains the 12th Thursday of the year. In 2009, January 1st. happened on a Thursday. As Jan 1st, 2010 happened on a Friday, it was on week 53 of 2009. --

Re: [SQL] installing uuid generators

2010-03-16 Thread Jorge Godoy
| The Programs Needed to Create and Run a PostgreSQL Server | package | python-storm-postgresql| PostgreSQL backend for python-storm | package And no, uuid-ossp isn't there. -- Jorge Godoy On Tue, Mar 16, 2010 at 20:29

Re: [SQL] Howto automatically define collumn names for a function result.

2009-08-27 Thread Jorge Godoy
ust an example code, I haven't tried it myself. I know it works for plpgsql functions, not sure for sql functions). Regards, -- Jorge Godoy On Thu, Aug 27, 2009 at 08:08, Andreas wrote: > Hi, > wouldn't it be great to have functions return "setof something" as r

Re: [SQL] Month/year between two dates

2009-08-12 Thread Jorge Godoy
| end_date ----+----+ 1 | 2009-01-01 | 2009-08-31 (1 row) test=# -- Jorge Godoy On Wed, Aug 12, 2009 at 00:59, ramasubramanian < ramasubramania...@renaissance-it.com> wrote: > Dear Bor, > How you will 1 record for 2009/05 (if you use 2009/05 ) it will fet

Re: [SQL] Composite UNIQUE across two tables?

2008-03-06 Thread Jorge Godoy
r can do that. Slower than denormalizing the database, but it can be done. -- Jorge Godoy <[EMAIL PROTECTED]> -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Installing with libs of postgresql-libs

2007-03-12 Thread Jorge Godoy
l-libs-8.2.3-1PGDG.i686.rpm > I think it is just a metter of rpm -qa postgresql-libs-8.2.3-1PGDG.i686.rpm > but I do not have the adm permissions. You don't need them to query or list the contents of uninstalled packages. -- Jorge Godoy <[EMAIL PROTECTED]> ---

Re: [SQL] Distribution of results

2006-11-06 Thread Jorge Godoy
n 90 and 2). Can anyone please help? > I believe this isn't hard if you use a statistical function. You can have one fairly quickly with PL/R. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 4:

Re: [SQL] [GENERAL] How to split a table?

2006-10-17 Thread Jorge Godoy
were looked at was bigger than 0.6 then he can use that rand() trick. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] on connect/on disconnect

2006-09-11 Thread Jorge Godoy
gresql.org/docs/8.1/interactive/sql-set-session-authorization.html Also just for completeness: http://www.securityfocus.com/bid/16650/info -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you chec

Re: [SQL] Multiple DB join

2006-08-15 Thread Jorge Godoy
Andrew Sullivan <[EMAIL PROTECTED]> writes: > On Tue, Aug 15, 2006 at 09:01:03AM -0300, Jorge Godoy wrote: >> I can think that spreading processing requirements should be one. And >> distributing load another one. Disk space can be solved with new disks and >> ta

Re: [SQL] Multiple DB join

2006-08-15 Thread Jorge Godoy
stributing load another one. Disk space can be solved with new disks and tablespaces, but we can't yet distribute the load through several servers without partitioning. -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)---

Re: [SQL] Constraint UNIQUE on a column not case sensitive

2006-07-01 Thread Jorge Godoy
r(MyColumn)); -- invalid syntax > > The idea is to have an index on that column, in a not case sensitive form, > i.e. lower(MyColumn). What's the problem with CREATE INDEX then? CREATE INDEX idx_something ON mytable (lower(mycolumn)); -- Jorge Godoy <[EMAIL PROTECTED]

[SQL] (Ab)Using schemas and inheritance

2006-05-23 Thread Jorge Godoy
his has implications on permissions as well, so there will be a large number of groups -- probably at least one per schema + some common groups -- and roles as well... Is this a good idea? Would this be too bad, performance-wise, if I had thousands of schemas to use like that? Any advice on

Re: [SQL] Creating nested functions with plpgsql

2006-05-07 Thread Jorge Godoy
Having a procedural approach is not always the best algorithm, but, as I said, it solves almost all problems. Thanks, -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Returning String as Integer

2006-05-06 Thread Jorge Godoy
Em Sábado 06 Maio 2006 17:05, Ben K. escreveu: > Jorge Godoy <[EMAIL PROTECTED]> wrote: > > numbers. Is there any way to select a value from this column and return > > it as an integer? > > My twopence. I just happened to have the same problem with iReports for a > 10

Re: [SQL] Returning String as Integer

2006-05-05 Thread Jorge Godoy
:integer; int4 -- 123 (1 registro) testing=# -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Creating nested functions with plpgsql

2006-05-02 Thread Jorge Godoy
ter refactoring with nested functions. If it is not possible, are there any plans to allow this kind of thing? (Even with a different syntax it would be good to have it.) TIA, -- Jorge Godoy <[EMAIL PROTECTED]> ---(end of broadcast)--- TIP