[SQL] EXECUTE ... INTO?

2001-10-15 Thread Josh Berkus
Folks, Can anybody tell me the syntax for sending the result of an EXECUTE to a variable within a PL/pgSQL function again? Jan Wieck posted it to the list this summer, but the "searchable list archives" are bogging down. -Josh __AGLIO DATABASE SOLUTIONS___

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Aasmund Midttun Godal
I may be wrong, but I believe you should not have a semicolon after beginning a loop (in the for clause) and the IF NOT EXISTS clause should be different: you are probably wanting FOUND which is a special variable so you will have to do the select first and then check the FOUND variable afterw

Re: [SQL] Cenceptual help needed - periodic events

2001-10-15 Thread Josh Berkus
Pat, > I'm goofing around, designing a planned maintenance system. In a > couple of > weeks I'll be taking on the actual scheduling of tasks. How would you > experts out there approach this? I've beeen thinking I can approach > this two > ways. I'm working on a legal calendar system, and we're s

Re: [SQL] Restricting access to Large objects

2001-10-15 Thread Tom Lane
"Aasmund Midttun Godal" <[EMAIL PROTECTED]> writes: > How can I restrict access to large objects. You can't. This is one of the many deficiencies of large objects. regards, tom lane ---(end of broadcast)--- TIP 3: if posti

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Tom Lane
leo <[EMAIL PROTECTED]> writes: > CREATE FUNCTION editEmail(integer, smallint, varchar, varchar) RETURNS > integer AS ' > ... > -- if it wasn't, then insert the new record. An undoubled quote mark in a function body is bad news... regards, tom lan

[SQL] When will vacuum go away?

2001-10-15 Thread Michael Richards
I've been watching for this for some time. First it was 7.0, then 7.1. Does anyone have any idea on when the row re-use code will be ready? Currently I'm running into trouble with an OLTP database. It grows like crazy, has only 3,000,000 rows and vacuum takes a good 1/2 hour. Given trouble w

Re: [SQL] problem w/plpgsql proc

2001-10-15 Thread Josh Berkus
Leo, You're gonna feel like a dork when I point it out ... > -- if the emailaddr was found, then update the record. > -- if it wasn't, then insert the new record. ^^^ SINGLE QUOTE HERE!! BAD! You can't have single quotes inside a function, especially in comments. They will be trea

Re: [SQL] SQL reference card

2001-10-15 Thread Josh Berkus
Bob, > I'm looking for a reference card for SQL. I've searched quite a lot, > but a > simple card > in PostScript/PDF seems to be hiding for me ;) It's not hiding from you. There isn't one. It'd be a little hard to reduce all of SQL to a two-sided card. The definition of SELECT alone would ta

Re: [SQL] Why would this slow the query down so much?

2001-10-15 Thread Tom Lane
Stuart Grimshaw <[EMAIL PROTECTED]> writes: > SELECT a.category, b.headline, b.added, c.friendlyname > FROM caturljoin as a > INNER JOIN stories as b ON (a.url = b.source) > INNER JOIN urllist as c ON (a.url = d.urn) > WHERE a.category = 93 ORDER BY b.added DESC LIMIT 1; (I assume

[SQL] Cenceptual help needed - periodic events

2001-10-15 Thread Pat M
I'm goofing around, designing a planned maintenance system. In a couple of weeks I'll be taking on the actual scheduling of tasks. How would you experts out there approach this? I've beeen thinking I can approach this two ways. 1) When a list of tasks is requested, generate new rows and store the

Re: [SQL] to_char()??

2001-10-15 Thread Lee Harr
> > how to > select substr('hi there',3,5) as xx -->> xx change char type > How about: select substr('hi there', 3, 5)::varchar(5) as xx; or is this not what you mean? ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to

Re: [SQL] GROUPING

2001-10-15 Thread Joel Burton
On Sat, 13 Oct 2001, Timothy J Hitchens wrote: > It's been a while since I used postgresql but today I have converted one > of my web apps but with one small problem. I goto do a group as > designed and executed in mysql and I get told that this and this must be > part of the aggreate etc I am p

Re: [SQL] Indexes

2001-10-15 Thread Aasmund Midttun Godal
On Sat, 13 Oct 2001 14:17:48 GMT, "Aasmund Midttun Godal" <[EMAIL PROTECTED]> wrote: > On Fri, 12 Oct 2001 19:33:46 -0700 (PDT), Stephan Szabo ><[EMAIL PROTECTED]> wrote: > Well, then another question; will a function be only evaluated once inside a query >with the specific arguments? > > i.e.

Re: [SQL] to_char()??

2001-10-15 Thread guard
thanks I have run "select substr('hi there', 3, 5)::varchar(5) as xx;" but get error message Error: ERROR: parser: parse error at or near ":" -- "Lee Harr" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :9qd0j0$1gc3$[EMAIL PROTECTED] > > > > how to > > select substr('hi there',3,5) as xx -->> xx change

Re: [SQL] GROUPING

2001-10-15 Thread Lee Harr
On Sat, 13 Oct 2001 03:32:57 + (UTC), <[EMAIL PROTECTED]> wrote: > It's been a while since I used postgresql but today I have converted one > of my web apps but with one small problem. I goto do a group as > designed and executed in mysql and I get told that this and this must be > part of th

[SQL] Restricting access to Large objects

2001-10-15 Thread Aasmund Midttun Godal
I can't find any docs / mails on this subject. How can I restrict access to large objects. 1.) Based on users. 2.) Rules/triggers? Thanx. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 ---(end of broadcast)--- T

[SQL] problem w/plpgsql proc

2001-10-15 Thread leo
Hi all - This might be the wrong forum for this, but I don't want to cross-post unless someone tells me I should. Anyways, I'm having a problem trying to compile this plpg proc. I'll post the proc and the errors. I'm coming from a T-SQL background, so hopefully when I get the hang of Pl/PgSQ

[SQL] count(*) and limit

2001-10-15 Thread Orion
I have a interface where users are paging through results of a query. In order to do so I need to select count(*) from data where stuff; To find out how many pages of data there are ( needed for the navigation bar) and then I need to select * from data where stuff limit X offset y; Now,

[SQL] Why would this slow the query down so much?

2001-10-15 Thread Stuart Grimshaw
I have 3 tables that I am trying to join together: -- Table "caturljoin" Attribute | Type | ---+-+ category | integer | url | integer | Index: caturljoin_url caturljoin_cat Table "stories" Attribute |

[SQL] SQL reference card

2001-10-15 Thread Bob Vloon
Hello, I'm looking for a reference card for SQL. I've searched quite a lot, but a simple card in PostScript/PDF seems to be hiding for me ;) Anyone?? Thanx in advance, Bob.. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Restricting access to Large objects

2001-10-15 Thread Aasmund Midttun Godal
I sent with the wrong email first. sorry. I can't find any docs / mails on this subject. How can I restrict access to large objects. 1.) Based on users. 2.) Rules/triggers? Thanx. Aasmund Midttun Godal [EMAIL PROTECTED] - http://www.godal.com/ +47 40 45 20 46 -- End Forwarded Message

Re: [SQL] [PHP] PEAR Problem

2001-10-15 Thread Dan Wilson
This is caused by the fact that PostgreSQL is case insensitive. In order for it to actually take the case into account, you need quote your field names and table names. So your query would then be: select "NetCode","NetworkName" from "NetworkTab"; Then you would be able to access the fields wit

Re: [SQL] [PHP] PEAR Problem

2001-10-15 Thread Papp Gyozo
Hi, maybe this problem isn't originated in PEAR, but in pg itself. Postgres folds everything to lowercase except one within "" (doublequotes). So, if you - ie.: in psql: psql=# CREATE TABLE veRYMixedCAse (NetCode integer,...); then actually you will create a table named 'verymixedcase'. In