e_Name text,
Column_Name text)
on ST.Table_Name = DV.Table_name
and ST.Column_Name = DV.Column_Name
where ST.Column_Name is null or DV.Column_Name is NULL
--
Lucas Brito
dblink(db_database1(), 'select "id", "name", "time" from
pr_1') as pr_1("id" integer, "name" text, "time" time)
then you will see the table "pr_1" on the datbase2
--
Lucas Brito
nce')":
select *,nextval('mysequence') from mytable;
But I think its not the best way to do this! Couse I need to set
sequence value to 1 everytime.
Can Someone help me?
Thanks
Lucas Vendramin (Brazil)
---(end of broadcast)---
T
Quoting Richard Huxton :
[EMAIL PROTECTED] wrote:
Hi.
Is there a way to create "default" constraint on UPDATE query.
It's becouse I have a bool field that may NOT support NULL value, but the
Front-End calls null for FALSE values.
Sounds like your frontend is broken.
Yes, it is. But I have no
e1_check), any are
complex... Is it a problem??? My tests are with few regs and run fine. Where
can I read more about triggers and performance?
Thanks for all.
---
Lucas Vendramin
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will
urns--
date_part |
1 |
It is the first week of year (2005), and how can I get what is the first date
references the week 1? Ex:
select week 1
--should return---
date |
20050103 | -- 3 Jan 2005
Thank you.
Lucas Vendramin
---(end of broadcast)-
- integer
How can drop a day to now()??
Try using "now()::date", or "interval". Like:
select * from clientes_proceso where fecha_mod::date <= now()::date -1;
or:
select * from clientes_proceso where fecha_mod::date <= now() - '1
day'::interval;
---
Lu
Quoting Daryl Richter <[EMAIL PROTECTED]>:
[EMAIL PROTECTED] wrote:
> Quoting Daryl Richter <[EMAIL PROTECTED]>:
>> It's hard to say without knowing more precisely what you are trying to
>> model, but I think this push you in the right direction:
>>
> Okay, but references between (output/input) a
Quoting Daryl Richter <[EMAIL PROTECTED]>:
It's hard to say without knowing more precisely what you are trying
to model, but I think this push you in the right direction:
-- This table takes the place of both SEND and BUY
create table activity(
id serial primary key,
prod
Ok,
But the problem is becouse the "buy" and "send" tables referencing with other
father table, wich is different.
I shoud not create a spent table to put the "buy" and "send" values
becouse the
entire database is more complex than it. look:
create table output(
id serial primary key,
client integ
Hi.
Is there a way to references dynamic tables? I.E:
I have a table called "buy" that create some records in "financial" table, but
there is other table called "send" that create other records in "financial".
"Financial" table have the moneys' movements and needs to be referenciable by
"buy or sen
Hi:
I've just migrated from Linux/PostgreSQL 7.2 to
Windows/PostgreSQL 8.0.3. I have a large view. When I make:
"Select . WHERE mydate = 'anydate'"
the view lasts 19 seconds to complete. But, when I make:
"Select . WHERE mydate >= 'anydate'"
the view lasts 7 minutes.
With PostgreSQL 7
Hi.
I have searched in mailing-list archives about converting types, but I couldn't
found a function or clause that convert a numeric type to money type.
How Can I convert this types?
=> select '1234'::money;
money
R$1.234,00
=> select '1234'::numeric::money;
ERROR: cannot cast
cursors
Here is what I am trying to do
for each table on the list
Select tablename, count(*) tables from ( list of tables)
tablename tables
table1 25
table2 35
Any Idea would be appreciated
Thanks
Lucas
---(end of broadcast)---
TIP 2: you can get
Hi.
The function works well...
I will use your function and rewrite it to accept more than one select,
becouse
in this case you selected all records from tb1 table. In real case the
table is
bigger with many fields and I will work with some filters and some ordering
(dynamically)...
Thank you.
Yes,
I tried it. In this table the query works fine, but in a big table
(with aprox.
200.000 records) the query performace is very bad.
I tried it (in the example table):
SELECT *,(select sum(value) from tb1 as tb1_2 where tb1_2.id<=tb1_1.id) as
subtot from tb1 as tb1_1 order by id;
In a small
Hi.
How can I sum a row and show the sum for each row???
For example, in a finances table that have the total movimentation(debit/credit)
in the bank.
i.e:
CREATE TABLE TB1 (id integer primary key, value numeric);
insert into tb1 values (1,20);
insert into tb1 values (2,2);
insert into tb1 values
Thanks
CTAS (Create Table As Select) command works fine!!! With great performance.
I think it is the best way to correct the data...(apparently)
I didnt know about "select DISTINCT". I am going to read about it.
Thank you.
Quoting Bricklen Anderson <[EMAIL PROTECTED]>:
Is there a way to del
Hi.
Thanks for the article...
But, I have read it and the query works very slow...
My table have aprox. 180.000 records (correct) and in entire table it has
aprox.360.000 records(duplicated)...
I tried to execute a query to delete the duplicated records, but it
worked very
very slow... look:
#
way to delete the duplicated data without build another table with
constraints and copy those data to the new table?
Something like "delete from table1 where ...???"
Thanks,
Lucas
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Do I have to create another table to put this data???
But, Isn't it redundancy? :-/
The question is: For example:
I have a "clients" table and I have a "taxes" table that is a chield
of client.
Is more efficient put fields into client table that contains:
-) the count for paid taxes
-) the c
Well...
Right, I will use to_timestamp() function instead of now() function.
But, what is the performance for those Triggers??? Considering that all tables
will have this Trigger and will check for each update or insert.
Thanks
Quoting CHRIS HOOVER <[EMAIL PROTECTED]>:
One change you might want to
Hi.
What is the better way to store the last record for a translation???
I.E:
The data for the last product vendding.
What is better:
a) Create a field in "product" table and create a Trigger (before insert or
update into vendding table) to alter this field.
b) Create a view or function that ch
Hi all,
I am building a database in postgresql and I made a function that returns the
system time and the current user... like this:
CREATE OR REPLACE FUNCTION generate_idx() returns text as
$$
select to_char(now(),'MMDDHHMISSUSTZ')||CURRENT_USER;
$$ language 'SQL';
CREATE OR REPLACE FUNC
Hi.
Is there a way to make a serial columm that works with father table???
I.e:
I have created a table called "vending" and its chield table called "items".
The items table have a serial columm, but I need the serial colum starts with 0
for each vending.
create table vending (
id serial prima
Okay, I will use the "order by" clause.
I was worried about it. I have thought that my database had crashed.
Thank you.
Quoting Oleg Bartunov :
This is a feature of relational databases, you should explicitly specify
ordering if you want persistent order.
btw, why do you bothering ?
Oleg
Shouldn't it
apper at the LAST record???
What need I do??
Thank you.
Lucas Vendramin
Brazil
---(end of broadcast)---
TIP 8: explain analyze is your friend
sult;
IF NOT result THEN
RAISE EXCEPTION 'The validate of the system field name is False';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER products_codes_checkfieldvalue BEFORE INSERT OR UPDATE ON
main.products_codes FOR EACH ROW EXECUTE PROCEDURE
trigger_sys
Oh sorry.
I was not clearly.
I've wanted to create a function that suport to select a "parameter variable"
table. Like: return 'select * from $1'.
The Postgresql does not suport this sql function becouse the $1 variable is
considerate as a table... the Postgresql return an error like: The table "$
Hi,
Can I built a generic function like:
CREATE FUNCTION f (text) RETURNS TEXT as
$$
return 'select * from $1';
$$
I know its impossible as writed. Also I have looked for EXECUTE procedure but it
not run the correct function.
Is there a way to construct this clause? Using plpgsql/pltcl/anyt
Hello.
Is there any way to build a table that contain the coluns name for the other
table fields? like this:
create table people(id serial primary key, name varchar(50) );
create table people_fields ( field_name varchar(30) );
insert into people_fields values ('occupation');
insert into people
Hi,
Is there a way to construct a multi schema in my data base?
Something like:
mysystem.finances.money.tables
mysystem.finances.money.functions
mysystem.finances.credits.tables
mysystem.finances.credits.functions
mysystem.amount.products..
Or can I use another database like:
Use a view per department, which show/hide the columns according to your
liking. Give each department a schema and put everything related to it
inside for cleanliness. Use UPDATE triggers on the views, which in fact
write to the products table, so that the departments can only update the
column
Hello all...
I am starting in Postgresql...
And I have a question:
I am developing a DB system to manage products, but the products may be
separated by departaments (with its respectives coluns)... Like:
CREATE TABLE products(
id serial primary key,
desc valchar(100),
...
);
Okay, but
Hi everybody ... i need to restore only one database from a pg_dumpall backup
file... how can i do it?
Thanks a lot !
--
Lucas Lain
Gerencia de IngenierĂa
TechTel Telecomunicaciones
[EMAIL PROTECTED]
TE. (54-11) 4000-3164
---(end of broadcast
Hi everybody ... i need to restore only one database from a pg_dumpall backup
file... how can i do it?
Thanks a lot !
---(end of broadcast)---
TIP 8: explain analyze is your friend
g' for the exact reason. It may be a
> problem related to locating certain shared libraries. The archives
> contain several instances where this problem is dicussed.
>
> --
> Peter Eisentraut [EMAIL PROTECTED]
>
>
> ---(end of broad
Wow, I had never actually faced this problem (yet) but I spied it as a
possible stumbling block for porting MySQL apps, for which the standard
practice is inserting a NULL. As I have made a fairly thorough reading
of the docs (but may have not cross-correlated every piece of data yet,
obviousl
Hi Nicholas,
CHAR fields, as opposed to VARCHAR, are blank-padded to the set length.
Therefore, when you inserted a < 25 character string, it got padded
with spaces until the end.
Likewise, when you cast '100058' to a CHAR(25) in the = below, it
gets padded, so it matches.
The LIKE operat
how can i compare two querys' eficiency???
TIA,
--
Lucas Lain
[EMAIL PROTECTED]
#! /Scripting/Manager (??)
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Full disclosure on previously posted Perl code: I think I may have
cribbed all or part of that previous code from something (Perl
cookbook?). In any case, the issue is essentially a mapping of which
ascii codes "look like" low-ascii, so I don't think there are any
authorship issues.
Best,
Ra
Hi Mallah,
I had this problem once, and put together this bunch of regexes. It's
by no means optimal, but should solve 90% and would easily be adapted
into a plperl function.
Begin perl:
$value =~ s/[\xc0-\xc6]/A/g;
$value =~ s/[\xc7]/C/g;
$value =~ s/[\xc8-\xcb]/E/g;
$value =~ s/[\xcc
Hi John,
(added to JDBC list)
1. What is your database encoding? Does it support the unicode OK?
2. Are you sure it's getting /stored/ as a question mark rather than
just displayed as such? Remember, if it is stored correctly, but you
look at it from a terminal that doesn't support the charact
accepts!
It must be a feature.. not a bug... I know I'm making a mistake.. but..
where??
bests regards
--
[]'s
Lucas Brasilino
[EMAIL PROTECTED]
http://www.recife.pe.gov.br
Emprel -Empresa Municipal de Informatica (pt_BR)
Municipal Computing Enter
;).
If PostgreSQL development group change it's point of view, I suppose
there's some advantage. Do you know some advantages ??
bests regards
--
[]'s
Lucas Brasilino
[EMAIL PROTECTED]
http://www.recife.pe.gov.br
Emprel -Empresa Municipal de In
a timestamp column?
I know it's quite simple question... but I haven't find any clue!
Thanks a lot in advance.
Bests regards
[]'s
Lucas Brasilino
[EMAIL PROTECTED]
http://www.recife.pe.gov.br
Emprel -Empresa Municipal de Informatica (pt_BR)
Municip
46 matches
Mail list logo