Peter Eisentraut <[EMAIL PROTECTED]> writes:
> make install-all-headers
That's not a complete solution though; the headers are only half the
problem. Makefiles are the other half, and our story on them is pretty
bad. For instance I've been meaning to ask what to do about this open
bug report:
h
Kemin Zhou wrote:
> IN chapter 33 Extending SQL
> 33.7.5 Writing Code
> when run pg_config --includedir-server
> I got /usr/local/pgsql/include/server but my machine does have this
> directory
make install-all-headers
It's explained in the installation instructions.
---
On Wed, Apr 21, 2004 at 16:28:10 -0400,
Heflin <[EMAIL PROTECTED]> wrote:
> >
> >The postgres specific way of doing this is:
> >SELECT DISTINCT ON (auction.auction_id)
> > auction.auction_id, image.image_id, image.image_descr
> > FROM auction JOIN image ON auction.auction_id = image.auction_id
Two choices that work:
Either add another JOIN in which retrieves the MAX(image_id) for each
auction:
SELECT auction.auction_id, image.image_id, image.image_descr
FROM auction
JOIN image USING(auction_id)
JOIN ( SELECT auction_id, MAX(image_id) AS image_id
FROM image
On Wed, Apr 21, 2004 at 14:29:34 -0400,
Heflin <[EMAIL PROTECTED]> wrote:
>
> So a basic JOIN gets this:
>
> SELECT auction.auction_id, image.image_id, image.image_descr
> FROM auction JOIN image ON auction.auction_id = image.auction_id
> WHERE auction.auction_owner = 'Mabel';
>
> Now the prob
Bruno Wolff III wrote:
On Wed, Apr 21, 2004 at 14:29:34 -0400,
Heflin <[EMAIL PROTECTED]> wrote:
So a basic JOIN gets this:
SELECT auction.auction_id, image.image_id, image.image_descr
FROM auction JOIN image ON auction.auction_id = image.auction_id
WHERE auction.auction_owner = 'Mabel';
Now
Here I have a very simple case
table1
table1_removed
anotherTable
create or replace RULE rec_remove as ON DELETE TO table1
do insert into table1_remove
select old.*, a.acc from old g join anotherTable a on g.acc=a.other_acc;
===
the parser complained ERROR: relation "*OLD*" does not exist
I read a lot of document and did some search and looked at the source
code of postgres but did not find a simple
solution to my question.
How to set up the programming environment for C.
IN chapter 33 Extending SQL
33.7.5 Writing Code
when run pg_config --includedir-server
I got /usr/local/pgsql
OK, it's been a while since I've had to do anything remotely complex in
SQL, so this may just be a pure brain block on my part.
I have 2 tables, auction and image, defined like this:
Table "public.auction"
Column | Type |
On Wed, Apr 21, 2004 at 12:58:56 +0530,
[EMAIL PROTECTED] wrote:
>
> The code looks like:
>
> update tempxitag set qty = qty + nqty where
> ccod = cccod
> GET DIAGNOSTICS nFound = ROW_COUNT;
> If nFound = 0 then
> insert into tempxitag( ccod,
Sorry. I realize I slipped an error in my code:
the code is:
---
CREATE TABLE public.imp_test
(
id int8,
value text
) WITHOUT OIDS;
CREATE OR REPLACE FUNCTION public.imp_test_to_out_test(imp_test)
RETURNS imp_test AS
'begin
return $1;
end;'
LANGUAGE 'plpgsql' ST
Is there some reason you can't do this:
SELECT DISTINCT
date_part('year', uu.add_date), date_part('month', uu.add_date),
date_part('day', uu.add_date)
FROM uus INNER JOIN ui ON uus.user_id=ui.id INNER JOIN uu ON
ui.id=uu.user_id
WHERE uus.x_id=1
ORDER BY
uu.add_date DESC;
This might be
Hi all,
first of all, let me explain what I'm trying to do.
I have a table with a fairly complicated trigger. In this trigger I
have a specific set of codelines that can be executed in more than 50
places that works on the new.* fields in order to fix/clean them.
In order to improve readability,
This is a not-quite complete implementation of the SY/MS sql datediff. The
months_between function can be extrapolated from it as well. I looked for
it on forums, etc. and all I found were people complaining about the lack of
an example. Please post fixes/changes or a link to a better one... if
David,
I tend to use \ to escape things like ' - I find it makes it somewhat easier
to debug.
What about:
sql_string :=\' INSERT INTO temp_table ( view_name, row_count ) SELECT \'
|| r_rec.viewname ||
\', count(*) FROM \'
||
Thank you and Denis ([EMAIL PROTECTED]) - that was it. I needed
explicit DESC for each ORDER BY criterium.
Otis
--- Stijn Vanroye <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I am trying to select distinct dates and order them in the reverse
> > chronological order. Although the column type i
On Tue, Apr 20, 2004 at 09:14:48PM +0200, H.J. Sanders wrote:
>
> - BEGIN WORK
>
> - INSERT ROW
>
> - IF FAILED THEN UPDATE ROW
>
> - COMMIT WORK
You can do it the other way. Begin, update; if 0 rows are updated
then insert.
A
--
Andrew Sullivan | [EMAIL PROTECTED]
---
> Hello,
>
> I am trying to select distinct dates and order them in the reverse
> chronological order. Although the column type is TIMESTAMP, in this
> case I want only , MM, and DD back.
>
> I am using the following query, but it's not returning dates back in
> the reverse chronological ord
Hello,
I am trying to select distinct dates and order them in the reverse
chronological order. Although the column type is TIMESTAMP, in this
case I want only , MM, and DD back.
I am using the following query, but it's not returning dates back in
the reverse chronological order:
SELECT DIST
Hi Try this..
SELECT Col1 , Col2
FROM yourtable
WHERE to_number(to_char(col1, 'SS'),'99') / 10 ) in
(10,20,30,40,50,00);
HTH
Denis
> - Original Message -
> From: Vincent Ladlad <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 21, 2004 8:23 AM
> Subject: [S
20 matches
Mail list logo