Hello,
Maybe this query can help you
SELECT p.name, l.name
FROM location l
INNER JOIN product_move m ON m.source_location = location.id
INNER JOIN product p ON m.product_id = p.id
WHERE p.id = $product_id
AND m.datetime < $given_date
ORDER BY datetime DESC LIMIT 1
It will return the name of the
Hello everyone! I wanted to ask the list a question about the 'bytea'
data type & how I can picture this in my head. I've been reading SQL
for about a few months now and since then, I've only been working with
textual data. Basically I'm familiar with storing text and numerical
characters into tabl
the primary key constraint so I don't know if that was a good
/ bad idea. Thanks for any info / help!
-Carlos
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
On Fri, May 11, 2012 at 3:43 PM, Adrian Klaver wrote:
> Well the question to ask is if it is declared CHAR was that done for a
> legitimate reason? One reason I can think of is to have leading 0s in a
> 'number'. Might want to double check that code downstream is not depending
> on CHAR behavior.
On Fri, May 11, 2012 at 3:44 PM, Thomas Kellerer wrote:
> Use this:
>
> alter table users
> alter column users_id type integer using to_number(users_id, '9');
>
> (Adjust the '9' to the length of the char column)
When you wrote "Adjust the '9' to the length of the char column,
do y
Thanks for all the help thus far everyone! I sadly didn't
create/design the table and would love to create a SEQUENCE on that
particular field but not sure how unless I DROP the table and create
from scratch.
Currently the data TYPE on the primary key field (users_id) is CHAR
and I have no idea wh
I have a problem in SQL I don't know how to solve and while I'm sure
there are 100+ ways to do this in ANSI SQL, I'm trying to find the
most cleanest / efficient way. I have a table called 'users' and the
field 'users_id' is listed as the PRIMARY KEY. I know I can use the
COUNT function, then I kno
FROM customers
forza-# WHERE cust_name = 'iamUNIX'
forza-# ;
cust_id | cust_name | cust_address | cust_contact |
cust_email
+---+---++
16 | MobileNX | 200 South Shore Drive | Carlo
I don't know if this is an issue with my client (Psql) or if it's
something I'm doing wrong but I've noticed this issue before and can't
figure it out. When I'm using the psql client, I really rely on the
tab / type ahead auto completion. When I run my command on one single
line, it works fine but
I changed to the suggested database which is owned by 'Carlos' and did
as instructed. Everything worked fine. Thank you!
On Thu, Mar 1, 2012 at 11:23 AM, Carlos Mennens
wrote:
> I did do a Google search for "PostgreSQL 9.1 change ownership
> recursively" but eithe
E-RSA-AES256-SHA, bits: 256)
You are now connected to database "postgres" as user "carlos".
postgres=# REASSIGN OWNED BY carlos TO lauren;
REASSIGN OWNED
postgres=# DROP OWNED BY carlos;
DROP OWNED
iamunix=# \d
List of relations
Sc
Ctype|
Access privileges
---+--+--+-+-+---
iamunix | lauren | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
All tables still owned by Carlos:
iamunix=# \d
List of relations
Schema | Name | Type
I've noticed when I set a field to char, it takes up lots of space over varchar:
iamunix=# SELECT * FROM music;
id | band| album |date|
asin|label
+---+--+---
I'm new to SQL so I'm looking for a way to change several email
addresses with one command. For example everyone has a 'holyghost.org'
domain and I need to change a few 100 email addresses in the field
'emp_email'. I need to UPDATE employees table which has a COLUMN
'emp_email' and change %holyghos
I seem to have an issue where I can't modify a table due to another
tables foreign key association:
[CODE]trinity=# \d developers
Table "public.developers"
Column| Type | Modifiers
--++---
id | character(10) | not null
name
On Wed, Jan 11, 2012 at 7:13 PM, David Johnston wrote:
> However, I will say again, you DO NOT WANT TO ACTUALLY DO THIS!
>
> The specific issue is that some US Postal Code begin with a zero ( 0 ) and
> so whenever you want to the zip_code value you need to pad leading zeros if
> the length is less
I have an issue I can't figure out. I have the following TABLE:
tysql=# \d customers
Table "public.customers"
Column| Type | Modifiers
--++---
cust_id | character(10) | not null
cust_name| character(50) | not null
cust_a
Does it matter when writing SQL code in PostgreSQL if I use DECIMAL or
NUMERIC date types for a column named 'price' assuming it's to store
the associated items actual dollar amount?
Reading the fine manual*, I can't find a single difference between
either and they both are supported / recognized
I'm trying to understand when in SELECT statements should and should I
not use single quotes to filter my results. For example:
SELECT * FROM people
WHERE fname = 'James';
or
SELECT * FROM price
WHERE msrb
BETWEEN 50 AND 100;
Now is it correct to say that in PostgreSQL or ANSI SQL in general I
El Lun 24 Sep 2007 21:38, chester c young escribió:
> I'm getting lots of delimited files from Excel and MySQL users that,
> mid-file, begin truncating lines if ending in null values.
>
> for example:
> 1781: "one","two","three",,
> 1782: "one","two","three",,
> 1783: "one","two","three",,
>
uals to '1' will be locked to other
transactions until the COMMIT command be executed.
So, how can I detect if this row is locked?
Tks
Carlos Henrique Iazzetti Santos
Compels Informática
Santa Rita do Sapucaí - MG
www.compels.net
LOCK command inside a TRANSACTION but I didn't
see how I could do that yet.
Does anybody have any ideas?
Carlos Henrique Iazzetti Santos
Compels Informática
Santa Rita do Sapucaí - MG
Brazil
www.compels.net
__
Fale com seus amigos de graça
Hi!
I need to query a select that returns all the fields of an specific primary
key, but I don't have the single column's name that is constrained as primary
key.
How can I do that?
Something like:
SELECT * FROM myTable WHERE myTable.pkey = 'foo';
Thanks
Carlos Henr
All my columns have the same data type: text.
So it's much easier.
Carlos Henrique Iazzetti Santos
Compels Informática
Santa Rita do Sapucaí - MG
www.compels.net
- Mensagem original
De: Richard Huxton
Para: Carlos Santos <[EMAIL PROTECTED]>
Cc: Lista PostgreSQL SQ
nternal
function or through a Procedural Language?
Thanks
Carlos Henrique Iazzetti Santos
Compels Informática
Santa Rita do Sapucaí - MG
BRAZIL
www.compels.net
___
Você quer respostas para suas p
It´s just want I need! Perfect! Thanks!
Carlos
> -Mensagem original-
> De: Richard Broersma Jr [mailto:[EMAIL PROTECTED]
> Enviada em: sábado, 1 de julho de 2006 18:45
> Para: [EMAIL PROTECTED]; pgsql-sql@postgresql.org
> Assunto: Re: [SQL] Left join?
>
>
>
=# select * from reqtran;
codreq | codsol | codate | codfec
+++
1 |||
2 | 1 ||
3 | 1 | 1 |
4 | 1 | 1 | 1
(4 rows)
Thanks in advance,
Carlos
of waiting until the COMMIT
is issued :-)
Carlos
--
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
Andrew Sullivan wrote:
On Tue, Apr 12, 2005 at 10:55:30AM -0400, Carlos Moreno wrote:
I guess the concern came up as result of a particular
situation, in which failing to properly process the
trigger function is not that crucial (I wanted to
update some additional information that is "opt
you deal with this? Well, you test.
Fair enough.
Thanks!
Carlos
--
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
op
it).
Isn't this a little fragile? Is there something I
could do to avoid this situation? Should trigger
functions be extremely simple as to guarantee that
an error would never happen?
Thanks,
Carlos
--
---(end of broadcast)---
TIP 3: if posti
been and is currently in use?
My guess is that there should be no problem and no risk in
doing that -- but being my first steps in PL, I wouldn't
like to trust a beginner's intuition for a production
system.
Thanks,
Carlos
--
---(end of broadcast)-
t is necessary, or
what implications -- positive or negative -- it may have)
Am I doing the right thing? Have I introduced some sort
of catastrophe waiting to happen?
Thanks for any guidance you may offer to this PL/PGSQL
beginner!
Carlos
--
---(end of broadcast)-
in postgres database i created a table with a field like
create table (...)
(...)
var text default '' not null
(...)
now i need to import the data from this table into a oracle database
i used pg_dump
I altered the field data type to
(...)
var varchar2(50) default '' not null
(...)
but when i
hi to all
I am doing a webpage and i manipulate data from a postgres database.
I need to do the same thing with a oracle database.
I am using pg_dump to transfer the database data from postgres to oracle
but there are a few problems with same data types in a table when i try to
import it to a ora
hi to all
I am doing a webpage and i manipulate data from a postgres database.
I need to do the same thing with a oracle database.
I am using pg_dump to transfer the database data from postgres to oracle
but there are a few problems with same data types in a table when i try to
import it to a ora
hi to all
i need to do a query to a small postgres database
my best efort to the pretended query is in the attached file 'query.txt'
but i need that some rows don't be selected of thouse that the query
returns.
i send in another attached file 'result.txt' with the query result. looking
at conte
elect distinct field1, field2, field3 from table1
order by field1, field2;" WORKS FINE.
These last situation are in a transaction whith some tables locked, that
aren't table1.
TIA
Carlos.
Solaria Mediterranea, S.L.L:
P.S.: please send me the answers directly, because I isn't su
38 matches
Mail list logo