Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Bruno Wolff III
On Fri, Jan 31, 2003 at 23:47:27 +1100, Matthew Horoschun <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm implementing a system where I need to be reasonably careful about > security. One thing that worries me is SEQUENCES. > > My understanding is that I need to GRANT the UPDATE privilege on the

Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Stephan Szabo
On Sat, 1 Feb 2003, Matthew Horoschun wrote: > > On Saturday, February 1, 2003, at 03:43 PM, Tom Lane wrote: > > > Matthew Horoschun <[EMAIL PROTECTED]> writes: > >> Should I just avoid SEQUENCES altogether and use the OIDs under normal > >> circumstances and the MAX( id ) + 1 style thing when I

Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Matthew Horoschun
On Saturday, February 1, 2003, at 03:43 PM, Tom Lane wrote: Matthew Horoschun <[EMAIL PROTECTED]> writes: Should I just avoid SEQUENCES altogether and use the OIDs under normal circumstances and the MAX( id ) + 1 style thing when I need a human-usable number? I don't think so. MAX()+1 has m

Re: [SQL] Which version is this?

2003-01-31 Thread Rajesh Kumar Mallah.
your question doesnt' seem to be very clear. But the following appeared in release note of version 7.2 hope it helps regds mallah. ` A.5. Release 7.2 Release date: 2002-02-04 A.5.1. Overview This release improves PostgreSQL for use in high-volume applications. Major

Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Tom Lane
Matthew Horoschun <[EMAIL PROTECTED]> writes: > Should I just avoid SEQUENCES altogether and use the OIDs under normal > circumstances and the MAX( id ) + 1 style thing when I need a > human-usable number? I don't think so. MAX()+1 has more than enough problems of its own. The real bottom line

Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Matthew Horoschun
Hi Tom, Thanks for the response. On Saturday, February 1, 2003, at 03:09 PM, Tom Lane wrote: Matthew Horoschun <[EMAIL PROTECTED]> writes: My understanding is that I need to GRANT the UPDATE privilege on the SEQUENCE if I want a user to be able to to use nextval() on it. The trouble is, if th

Re: [SQL] Controlling access to Sequences

2003-01-31 Thread Tom Lane
Matthew Horoschun <[EMAIL PROTECTED]> writes: > My understanding is that I need to GRANT the UPDATE privilege on the > SEQUENCE if I want a user to be able to to use nextval() on it. The > trouble is, if they can do a nextval() they can also do a setval() So? With enough time on your hands, yo

[SQL] Controlling access to Sequences

2003-01-31 Thread Matthew Horoschun
Hi All, I'm implementing a system where I need to be reasonably careful about security. One thing that worries me is SEQUENCES. My understanding is that I need to GRANT the UPDATE privilege on the SEQUENCE if I want a user to be able to to use nextval() on it. The trouble is, if they can do a

Re: [SQL] For each record in SELECT

2003-01-31 Thread Andrew J. Kopciuch
On Friday 31 January 2003 14:21, Luis Magaña wrote: > Hi, > > I have a question here: > > I have a table with this fields: > > month > description > amount > > now I have to write a query that retrieves the sum of the amount from > the minimum month to the maximum month registered for each diferen

Re: [SQL] CSV import

2003-01-31 Thread Guy Fraser
FYI In text files on a Mac. the EOL character is a only. What a messy thing this whole EOL cruft is. To convert between these text formats on linux is easy if you have dos2unix. The dos2unix on linux can perform many format conversions to and from unix,dos and mac formats. On BSD you need do

[SQL] For each record in SELECT

2003-01-31 Thread Luis Magaña
Hi, I have a question here: I have a table with this fields: month description amount now I have to write a query that retrieves the sum of the amount from the minimum month to the maximum month registered for each diferent description. Of course there are cases when a particular description h

Re: [SQL] Postgres MD5 Function

2003-01-31 Thread Joe Conway
Larry Rosenman wrote: --On Friday, January 31, 2003 01:34:42 -0800 David Durst <[EMAIL PROTECTED]> wrote: Does there exsist a MD5 Function I can call??? look at /contrib/pgcrypto in the source distribution. Also worth noting is that 7.4 will have (and cvs HEAD has) a builtin md5 function: r

Re: [SQL] Postgres MD5 Function

2003-01-31 Thread Larry Rosenman
--On Friday, January 31, 2003 01:34:42 -0800 David Durst <[EMAIL PROTECTED]> wrote: Does there exsist a MD5 Function I can call??? look at /contrib/pgcrypto in the source distribution. If not, is there any interest in one? ---(end of broadcast)---

Re: [SQL] calculated expressions and index use

2003-01-31 Thread Tom Lane
Pavel Hlavnicka <[EMAIL PROTECTED]> writes: > I use 7.2.1. :( 7.2 certainly will fold "'now'::timestamp - '1 hour'::interval" to a timestamp constant. This could be a datatype compatibility issue (is created_at the same type? in particular, with/without time zone?) or it could be a selectivity i

Re: [SQL] calculated expressions and index use

2003-01-31 Thread Pavel Hlavnicka
Yes, you are right. It was an issue reated to the type compatibility. My braindead script created tables with 'datetime' types, what is 'timestamp without time zone' after I switched to 'timestamp', all works fine. Thanks a loc, the fact, you ensured me, that the constant expression should be

Re: [SQL] CSV import

2003-01-31 Thread Jean-Luc Lachance
In DOS and Windows, text lines end with . In Unix, text lines end with only. hex decoct =CTRL-M or 0x0D or 13 or 015 =CTRL-J or 0x0A or 10 or 012 Chad Thompson wrote: > > > > > Unix EOL is LF not CR. > > > > > > Is this the only difference between a dos and unix text fi

[SQL] Which version is this?

2003-01-31 Thread Wei Weng
Since which version PostgreSQL is able to do Vacuum Analyze even in the middle of a transaction, namely, insert, delete, update?     Thanks     Wei  

[SQL] Postgres MD5 Function

2003-01-31 Thread David Durst
Does there exsist a MD5 Function I can call??? If not, is there any interest in one? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] calculated expressions and index use

2003-01-31 Thread Pavel Hlavnicka
I use 7.2.1. :( Do you thing my considerations on constant vs. expression are correct? I tried different syntax, no success. Thanks Pavel Tom Lane wrote: Pavel Hlavnicka <[EMAIL PROTECTED]> writes: select * from foo where created_at >= 'now'::timestamp - '1 hour'::interval; My table is i