t adding a constraint on these 2 fields is the solution.
My question: Is this the correct way to go?
Respectfully,
Jorge Maldonado
be the best decision and why?
Regards,
Jorge Maldonado
On Fri, Oct 4, 2013 at 5:38 PM, David Johnston wrote:
> JORGE MALDONADO wrote
> > I have search for information about the difference between "unique index"
> > and "unique constraint" in PostgreSQL withou
y key" is "src_id + src_date". One "src_id" can exist for
several "src_date".
---
Table Lists
---
1. lst_id
2. lst_source (points to src_id)
3. lst_date
4. Other fields . . .
Here, the "foreign key" is "lst
on because our database has additional tables with the
same characteristics and maybe there would be many indexes.
With respect,
Jorge Maldonado
I have search for information about the difference between "unique index"
and "unique constraint" in PostgreSQL without getting to a specific answer,
so I kindly ask for an explanation that helps me clarify such concept.
Respectfully,
Jorge Maldonado
very possibility because it will have an impact on performance due to
index maintenance. What would be a good way to define indexes in a case
like this?
With respect,
Jorge Maldonado
I guess I am understanding that it is possible to set a unique index or a
unique constraint in a table, but I cannot fully understand the difference,
even though I have Google some articles about it. I will very much
appreciate any guidance.
Respectfully,
Jorge Maldonado
>> In your case it would be lpp_id as PK, and
>> lpp_person_id,lpp_language_id as unique constraint
>>
>> Thanks,
>> Anton
Is there a reason to do it the way you suggest?
Regards,
Jorge Maldonado
On Tue, Jul 23, 2013 at 5:02 PM, Anton Gavazuk wrote:
> Hi Jo
ial.
My question is: what should I configure as the primary key, "lpp_person_id
+ lpp_language_id" or "lpp_id"?
Is the role of a primary key different from that of a unique index?
With respect,
Jorge Maldonado
Is it valid to specify a SELECT statement as part of a JOIN clause?
For example:
SELECT table1.f1, table1.f2 FROM table1
INNER JOIN
(SELECT table2.f1, table2.f2 FROM table2) table_aux ON table1.f1 =
table_aux.f1
Respectfully,
Jorge Maldonado
I need to insert records into a table where one value is fixed and 2 values
come from a SELECT query, something like the following example:
INSERT INTO table1 fld1, fld2, fl3
VALUES value1, (SELECT fldx, fldy FROM table2)
Is this valid?
Respectfully,
Jorge Maldonado
as follows?
FROM listas_pre_titulos
INNER JOIN temp_lista_titulos ON
(listas_pre_titulos.lpt_titulo, listas_pre_titulos.tmd_album,
listas_pre_titulos.lpt_fuente)
NOT IN
(temp_lista_titulos.tmt_titulo, temp_lista_titulos.tmt_album,
temp_lista_titulos.tmt_fuente)
WHERE listas_pre_titulos.lpt_tipo = 3
W
results.
With respect,
Jorge Maldonado
On Thu, May 23, 2013 at 1:36 PM, David Johnston wrote:
> JORGE MALDONADO wrote
> > How does the EXCEPT work? Do fields should be identical?
> > I need the difference to be on the first 3 fields.
>
> Except operates over the entire tuple
he EXCEPT work? Do fields should be identical?
I need the difference to be on the first 3 fields.
Respectfully,
Jorge Maldonado
records will
be updated. Does field1 updates first, then field2 and, lastly, field3? or
What is the order in which updates are executed? If I need fields to be
updated in a certain order, should I use 3 UPDATE commands instead?
Respectfully,
Jorge Maldonado
song_name
Respectfully,
Jorge Maldonado
. Maybe compound
indexes is better. I will very much appreciate your advice.
Respectfully,
Jorge Maldonado
ry using a programming language and, after that, I
execute it. Is this a good approach to build such a query?
Respectfully,
Jorge Maldonado
Can I use a conditional expression in an UPDATE query like this:
UPDATE table_1 SET
field_1 =
CASE WHEN (condition) THEN (COALESCE(query_1, -1))
ELSE (COALESCE(query_1, -2))
END
With respect,
Jorge Maldonado
This solution gave me the result I need, but it seems the process takes
longer when COALESCE is added.
What do you mean with the comment of "and you are happy with its performance"
?
Does it have to do with performance?
Regards,
Jorge Maldonado
On Tue, Feb 5, 2013 at 10:07 PM, J
I have an UPDATE query with the following general structure:
UPDATE table1 SET (SELECT field FROM table2 WHERE conditions ORDER BY
order_field LIMIT 1)
Is it possible to assign a default value in case no results are returned by
the SELECT statement?
Respectfully,
Jorge Maldonado
condition
UNION
SELECT fields FROM tblTable WHERE condition
UNION
SELECT fields FROM tblTable WHERE condition
Respectfully,
Jorge Maldonado
from id3 and price 3)
id, price (record that comes from id4 and price 4)
I will very much appreciate any suggestion.
Respectfully,
Jorge Maldonado
than one artist, and this
is fine. What I would like to do is NOT to get several rows, one for each
different artist, but to join all of the artists in one column and display
only one row.
Is this possible?
Respectfully,
Jorge Maldonado
is the choice, or one index composed of both
initial and final date?
Regards,
Jorge Maldonado
On Sun, Sep 9, 2012 at 12:45 PM, David Johnston wrote:
> From: pgsql-sql-ow...@postgresql.org [mailto:
> pgsql-sql-ow...@postgresql.org]
> On Behalf Of JORGE MALDONADO
> Sent: Sunday, Septem
tried an ORDEY BY DESC but the result is the same. I will very much
appreciate your comments.
Respectfully,
Jorge Maldonado
this table and get
the values HTML DECODED and I wonder if there is a function that I can
include in such a statement for this purpose, for example "SELECT
htmldecode(fld1) FROM table1". I will appreciate anu comments about my
issue.
Respectfully,
Jorge Maldonado
I have a parent table and a child table. In order to detect duplicate
information I need to consider both tables. This means that a "duplicate
record" consists of one parent record and one or more child records.
Is there any standard approach to solve this issue?
Respectfully,
Jorge Maldonado
28 matches
Mail list logo