Обсуждение: prepared statements logging

Поиск
Список
Период
Сортировка

prepared statements logging

От
marcofuics@netscape.net
Дата:
Hi *
I am using the postgresql-8.2.3, with a jdbc-8.2-504.... (the GeoNet
webServer tool...) My question is :
Is the <<PostGresDB>> server able to log the whole <<SELECT>> query?
{made by a prepared statement????}
Looking at the log I can see only queries of the type:
(cut).............
LOG:  execute <unnamed>: SELECT * FROM Metadata WHERE id=$1
DETAIL:  parameters: $1 = '28'
DEBUG:  parse <unnamed>: SELECT schemaId, createDate, lastChangeDate,
source, isTemplate, uuid FROM Metadata WHERE id = 28
(cut).............
The strange is that my query has to search on a "Test vector data" and
in the whole log-file this word <<Test>> is not present!
My desire is to have a line where I can see:
SELECT    bla..bla...bla   FROM   Metadata    WHERE id = "...some
pattern...."   [maybe islike some pattern]
Thx in advance.
 
====================================================
Marco Fulcoli Vincenzo
Astrophysical, Advanced_Computing_Tech

Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.

placing position numbers on a query output

От
"Oliveiros Cristina"
Дата:
Hello, All,
 
I would like to know if Postgres has a function similar to ROW_NUMBER().
I would like that the output of a query looked something like this
 
     column1   column2
1       x1              x2
2       y1              y2
3       z1              z2
...
 
I suspect that my question has an easy and quick answer, but from my searches I couldn't find it yet :-(
 
Any help deeply appreciate
 
Best,
Oliveiros

Re: placing position numbers on a query output

От
"A. Kretschmer"
Дата:
am  Wed, dem 11.04.2007, um 16:50:17 +0100 mailte Oliveiros Cristina folgendes:
> Hello, All,
>
> I would like to know if Postgres has a function similar to ROW_NUMBER().
> I would like that the output of a query looked something like this
>
>      column1   column2
> 1       x1              x2
> 2       y1              y2
> 3       z1              z2
> ...
>
> I suspect that my question has an easy and quick answer, but from my searches I
> couldn't find it yet :-(

You can do this either in the client-app or, for instance, with a
sequence like this:

test=# create table test (a text);
CREATE TABLE
test=*# insert into test values ('a');
INSERT 0 1
test=*# insert into test values ('c');
INSERT 0 1
test=*# insert into test values ('b');
INSERT 0 1
test=*# commit;
COMMIT
test=# create sequence s_test;
CREATE SEQUENCE
test=*# select nextval('s_test'), a from (select a from test order by 1)
foo;
 nextval | a
---------+---
       1 | a
       2 | b
       3 | c
(3 rows)


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net