Hi,
since I am new to writing stored procedures I'd like to ask first bevore I
do a mistake.
I want to implement some kind of queue (fifo). There are n users/processes
that add new records to a table and there are m consumers that take out
these records and process them.
It's however possible for
Hello,
My problem is that I want to select the row with max(date) but also
limited with where clauses.
Select
test.name
from
test
where
test.name = foo.name
having max(test.date)
This is a subquery and is part bigger query. How I can select the row
with the max query.
ERROR: argument of
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
The name for what you're looking to build is a concurrent batch
processing system. Here's a basic one.
- -- adding processes
BEGIN;
INSERT INTO queue (queue_id, processing_pid, processing_start,
~ processing_status, foreign_id)
VALUES (DEFAULT, NULL, NU
Dear Gurus,
Version: 8.0.0rc4
The scene below might look funny but it's essential for our project:
[local]:tir=# select 'a' as asdf;
asdf
--
a
(1 row)
[local]:tir=# select case 'a' when 'a' then 1 else 2 end as asdf;
ERROR: failed to find conversion function from "unknown" to t
Hi, I am perplexed.
I tried to change the type of a column using the syntax I found in the
[ALTER TABLE] section:
ALTER TABLE "Mailboxes" ALTER COLUMN "Status" TYPE int4;
This shuld be no problem since the current type acutally is int4 and the
names are copy'n'pasted. The server responds as follo
On Wed, Jan 12, 2005 at 06:02:10PM +0100, KÖPFERL Robert wrote:
> ALTER TABLE "Mailboxes" ALTER COLUMN "Status" TYPE int4;
>
> This shuld be no problem since the current type acutally is int4 and the
> names are copy'n'pasted. The server responds as follows:
>
> ERROR: syntax error at or near "
On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote:
> My problem is that I want to select the row with max(date) but also
> limited with where clauses.
If you don't mind using a non-standard feature then try SELECT
DISTINCT ON (not just DISTINCT, but DISTINCT ON):
http://www.po
while you weren't looking, KÖPFERL Robert wrote:
> ERROR: syntax error at or near "TYPE" at character 47
What version are you running? To my knowledge, altering the type of a
column is a new feature to 8.0.
/rls
--
:wq
---(end of broadcast)---
On Wed, Jan 12, 2005 at 05:52:42PM +0100, Sz?cs Gábor wrote:
> Question: is there a way to tell the server to convert unknown to something
> (text or varchar, don't really care), or to write such a "conversion
> function"?
You ought to be able to cast (e.g. "SELECT case 'a'::text. . .)
A
--
A
=?ISO-8859-2?Q?Sz=FBcs_G=E1bor?= <[EMAIL PROTECTED]> writes:
>[local]:tir=# select case 'a' when 'a' then 1 else 2 end as asdf;
>ERROR: failed to find conversion function from "unknown" to text
> This worked up to v7.4.6, and couldn't see it in the "Migration" part of the
> HISTORY file.
Kaloyan Iliev Iliev wrote:
>select test.name
>from test
>where test.name = foo.name
>having max(test.date)
I don't think you use the "having" clause like you've done there. I
think you want to be doing something more like:
select test.name
from test
where test.name = foo.name
and t
On Wed, Jan 12, 2005 at 10:11:21AM -0700, Michael Fuhr wrote:
> On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote:
>
> > My problem is that I want to select the row with max(date) but also
> > limited with where clauses.
>
> If you don't mind using a non-standard feature then t
I need some help on the following problem. I have an account info table that has a hierarchy of accounts. The grouping goes from end user to organization to reseller. I have a PL/SQL function written that gives me the tree, so I just whittle it down by selecting the one id for a reseller:
selec
Hi,
I have a PL/SQL function which breaks up a comma-separated list of values
stored in one column, and uses that (along with other data) to make a new table.
My problem is that some of the incoming data is quoted e.g.
"value1, value2, value3"
Meaning that when I split on the commas, I end up
On Jan 12, 2005, at 1:08 PM, Kieran Ashley wrote:
I've tried using the replace() function to get rid of the ", but I
can't figure out how to use it without throwing an error. I tried
replace(col_name, '\"', '')
and several other permutations but to no avail, do I need to use
something like an A
I tried that. It starts spitting out the rest of the script to STDIN until it
gets to the next " (which is being used to quote a table name about 100 lines
further on" at which point it throws an error, and dies.
It seems it really wants me to escape it somehow, but neither '\"' or ''"'
seems
Thanks for the replay first.
Yes I use "having" like I have written. I can't use your query because
in subquery I must write again the whole WHERE clause.
But in the other mail in the tread there is the solution:)
Thanks again
Kaloyan
Sam Mason wrote:
Kaloyan Iliev Iliev wrote:
select test.nam
Thank You,
That's what I need. I know it was something simple but...
Now it works perfectly.
Thank's again.
Kaloyan Iliev
Michael Fuhr wrote:
On Wed, Jan 12, 2005 at 10:11:21AM -0700, Michael Fuhr wrote:
On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote:
My problem is that
Kieran Ashley wrote:
I tried that. It starts spitting out the rest of the script to STDIN until it gets to
the next " (which is being used to quote a table name about 100 lines further
on" at which point it throws an error, and dies.
It seems it really wants me to escape it somehow, but neither
On Wed, Jan 12, 2005 at 11:46:53AM -0700, Edmund Bacon wrote:
> Perhaps you are forgetting to double up on your quote chars?
If that's the problem then 8.0's dollar quoting will simplify
the situation:
CREATE OR REPLACE FUNCTION foo(text) RETURNS text AS $$
SELECT replace($1, '"', '');
$$ LANGUA
Ah! Fantastic.
Thank you so much. I'm still not entirely sure _why_ that works, but it
does... so I can go home now! ;)
Thanks again!
-Original Message-
From: Edmund Bacon [mailto:[EMAIL PROTECTED]
Sent: 12 January 2005 18:47
To: pgsql-sql@postgresql.org
Cc: Kieran Ashley
Subject:
On Jan 12, 2005, at 2:00 PM, Kieran Ashley wrote:
I'm still not entirely sure _why_ that works, but it does... so I can
go home now! ;)
You should look at section 37.2.1 in the current docs. 8.0 has a new
dollar quoting feature which makes this easier to deal with.
http://www.postgresql.org/do
22 matches
Mail list logo