Hi,
supposing to have a small DB:
TABLE a (
id SERIAL PRIMARY KEY
);
TABLE b (
id SERIAL PRIMARY KEY,
idA INTEGER NOT NULL REFERENCES a(id)
);
How can I inspect pg_schema/information_schema to "detect" the
relation between "b" and "a" via "idB"?
TIA
Roberto Colmegna
O [EMAIL PROTECTED] έγραψε στις Mar 16, 2006 :
> Hi,
>
> supposing to have a small DB:
>
> TABLE a (
> id SERIAL PRIMARY KEY
> );
>
> TABLE b (
> id SERIAL PRIMARY KEY,
> idA INTEGER NOT NULL REFERENCES a(id)
> );
>
> How can I inspect pg_schema/information_schema to "detect" the
> rela
Hello,
I have 2 tables where each table has a column named "comments" and the
tables are related as a one to many. I want to concatenate all the
comments of the many side to the one side so I wrote the following
plpgsql function to do so.
CREATE OR REPLACE FUNCTION fixcomments()
RETURNS
Hello
> EXECUTE 'UPDATE sale SET comments = ' ||
Use PERFORM instead
Alexey
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
> Hello,
>
> I have 2 tables where each table has a column named "comments" and the
> tables are related as a one to many. I want to concatenate all the
> comments of the many side to the one side so I wrote the following
> plpgsql function to do so.
>
>
> CREATE OR REPLACE FUNCTION fixcomment
> pg_catalog.pg_constraint is your (only?) friend.
I have already examintated this table without results. Seem not to be
a "human-readable" table :(
TIA
Roberto Colmegna
Tiscali ADSL 4 Mega Flat
Naviga senza limiti con l'unica Adsl a 4 Mega di velocità a soli 19,95
Tom Lane wrote:
In this particular case you could say
... GROUP BY 1 ORDER BY 1;
"ORDER BY n" as a reference to the n'th SELECT output column is in the
SQL92 spec. (IIRC they removed it in SQL99, but we still support it,
and I think most other DBMSes do too.) "GROUP BY n" is *not* in an
Hello,
I am using PostgreSQL 8.0.1.
In a function, I try to use exception to catch sql errors:
begin
begin
exception
WHEN ??? THEN
end;
...
end;
The place where I have ???, what I should put there please?
e.g.,
1. WHEN sqlcode = '02000' THEN
2. WHEN no_data then
3
Is there a way to execute an external i.e. system command from inside a
pl/pgsql function?
Alex
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's data
am 16.03.2006, um 13:39:57 -0500 mailte [EMAIL PROTECTED] folgendes:
>
>
> Is there a way to execute an external i.e. system command from inside a
> pl/pgsql function?
You can call a untrusted function (plperlu, plsh, ...) and inside this
function you can call system commands.
HTH, Andreas
--
Emi Lu wrote:
exception
WHEN ??? THEN
The place where I have ???, what I should put there please?
e.g.,
1. WHEN sqlcode = '02000' THEN
2. WHEN no_data then
no_data
See ch 35.7.5. "Trapping Errors" for an example
3. other ways?
From the 8.0 docs, I am not be able to f
Hi Pedro,
|> The place where I have ???, what I should put there please?
|>
|> e.g.,
|> 1. WHEN sqlcode = '02000' THEN
|> 2. WHEN no_data then
|> 3. other ways?
|>
|> From the 8.0 docs, I am not be able to find Constant values of all
|> error codes.
|> http://www.postgresql.org/docs/8.
From the page:
"The PL/pgSQL condition name for each error code is the same as the
phrase shown in the table, with underscores substituted for spaces.
For example, code 22012, DIVISION BY ZERO, has condition name
DIVISION_BY_ZERO. Condition names can be written in either upper or
lower case
On Thursday 16 March 2006 19:32, Emi Lu wrote:
|> Errors I got are:
|> syntax error at or near "SQLSTATE" at character 2613
|> LINE 58:RAISE NOTICE 'H [%,%]', SQLSTATE, SQL...
|>
|>
|> Should I install any patches or do anything elese to have SQLSTATE and
|> SQLERRM work for me?
Emi Lu <[EMAIL PROTECTED]> writes:
> Should I install any patches or do anything elese to have SQLSTATE and
> SQLERRM work for me?
Update to 8.1 ...
regards, tom lane
---(end of broadcast)---
TIP 3: Have you checked our ext
this should work,
#
SELECT date_trunc('day',endtime),count(*)
FROM eg_event where endtime >= '2006-02-01' and endtime < '2006-03-01'
GROUP BY 1
ORDER BY 1;
hope this helps
best regards,
Stefan
Am Donnerstag, 16. März 2006 06:18 schrieb Bryce Nesbitt:
> I've got a working query:
>
16 matches
Mail list logo