Hi.
I am looking for an easy way to backup views and functions. I want to store
them in our version control system.
Well... As far as I can see, for functions you should go to the 'pg_catalog'
schema, table 'pg_proc'. In column 'prosrc' you will find the original text,
but other attributes a
ias nos select e update, uma vez que não há join envolvidos
Cumprimentos,
Hélder M. Vieira
create or replace function trava_inadimplentes ( pdias_vencido integer,
pund_local varchar(3), pcnpj varchar(18) ) returns boolean as
$$
declare
spermite_bloqueio varchar(1);
inro_re
Bom dia.
...
acusado o seguinte erro "sintax error at or near "SELECT" at character 487", e infelizmente não conseguimos achar o que esta
errado, dai peço ajuda aos colegas. Segue abaixo a procedure:
...
IF ( pCNPJ = '' ) THEN
BEGIN
...
END IF
...
Numa leitura sumária, parece-me qu
... SELECT tot.status, COUNT(total)
FROM( QUERY A UNION QUERY B ) AS tot
GROUP BY tot.status
But it doesn't works. It doesn't add the total columns with the same
status...
...
I guess you have two problems, if I understand what you're trying to do.
- As Roberto Spier noted, 'sum' would be be
eate temporary table mytesttable (like mymaintable excluding constraints
excluding defaults);
Regards,
Hélder M. Vieira
---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate
selected rows or, perhaps, use the SELECT in the FOR..LOOP and subsequently
perform the DELETE.
Hélder M. Vieira
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command
sum there.
The query:
select distinct on (id_prod) id_prod, id_unit, sum(quantity) as result
from products where determinant = false group by id_prod, id_unit
select id_prod, id_unit, sum(quantity) as result
from products
where determinant = false
group by id_prod, id_unit
Hélder M. Vieira
Eduardo, creio que o problema decorre do jogo de caracteres usado...
No meu caso, uma vez que vivo em Portugal, uso o jogo LATIN9 quando crio uma
nova base de dados.
Simplificando:
CREATE DATABASE xpto
WITH OWNER = postgres
ENCODING = 'LATIN9'
TABLESPACE = pg_default;
users:
Until now, I've been selecting LATIN1 encoding, but after a few tests, I
came to think that LATIN9 is a better option (the euro sign...).
For those who regularly use LATIN9, what is your opinion ? Is it indeed a
better option ?
Thank you.
Hélder M. Vieira
LATIN CAPITA
This is true of just about everything, not only max() -- there are *no*
functions yielding varchar in recent PG releases
Thanks for the information. I added an explicit cast to the max() output and
it works fine.
Anyway, for those using VB, this is potentially hazardous. Knowing that the
underl
x27;);
insert into test (testcol) values ('B');
insert into test (testcol) values ('B');
insert into test (testcol) values ('C');
insert into test (testcol) values ('C');
select max(testcol) from test;
Thank you
Hélder M. Vieira
-matching.html), it
isn't mentioned in section '9.4. String Functions and Operators'
(http://www.postgresql.org/docs/8.1/interactive/functions-string.html).
Hélder M. Vieira
---(end of broadcast)---
TIP 6: explain analyze is your friend
Namely, in MySQL I can say: "SHOW TABLES FROM 'dbname'" to list tables
in a database I'm not currently connected to.
In MySQL, table definitions are replicated outside the database files, and
might therefore be available without connecting to a specifc database.
This probably happens because of
I'm interested in encrypting an column in table. Are there any example
using "C" to create the encrypted column, inserting and retreiving data
to/from it?
the table is:
CREATE TABLE mytable (
id SERIAL PRIMARY KEY,
crypted_content BYTEA );
I'm getting (null) in the field with the follow
Is there a way to do something like a
'select * where forename_1,forename_2,surname like '%String%' ??
You could try the following, but it won't get a medal for performance...
SELECT * FROM xpto WHERE forename_1 LIKE '%String%' OR forename_2 LIKE
'%String%' OR surname LIKE '%String%'
15 matches
Mail list logo