John Fabiani jo...@jfcomputer.com wrote:
Yes I understand - but I want to know is it possible? Can I read the data I
just inserted without a commit.
[...]
Are you talking about a web application? Then no, you'll
have to code that yourself.
Tim
--
Sent via pgsql-sql mailing list
(anonymous) wrote:
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national
phone number format.
I'm especially interested in a solution for Germany, Swizerland and Austria.
I've got everything in a phone number column that makes hardly sense
Edward W. Rouse ero...@comsquared.com wrote:
Hehe, thanks, I played around and ended up with this:
round(SUM(extract('epoch' from (time_out - time_in
I will have to do the division outside of the query, but that's really a
minor issue.
You can always use subqueries.
I wrote:
I frequently use pg_dump to dump databases and compare them
with diff. To get rid of most false positives, I'd like
to patch pg_dump to sort the table so that its dumped order
isn't changed more than necessary by insertions Co.
So I'm looking for a query that will return a list
Hi,
I just tried to input a hexadecimal number in PostgreSQL
(8.4) and was rather surprised by the result:
| tim=# SELECT 0x13;
| x13
| -
|0
| (1 Zeile)
| tim=# SELECT 0abc;
| abc
| -
|0
| (1 Zeile)
| tim=#
The documentation says:
| A token can be a key word, an identifier,
MaurĂcio Cruz c...@sygecom.com.br wrote:
I'm trying to use lo_import to import a file into my
database, if I execute from postgres runing in my local
machine
it works perfectly, but if I do it in the postgres runing in
the server, it says No such file or directory
I Guess postgres only see
Hi,
I frequently use pg_dump to dump databases and compare them
with diff. To get rid of most false positives, I'd like
to patch pg_dump to sort the table so that its dumped order
isn't changed more than necessary by insertions Co.
So I'm looking for a query that will return a list of a
Harald Fuchs hari.fu...@gmail.com wrote:
hi, i am fairly new in postgresql, so if anyone can help me would be great
if i simply do:
select ver_no
from version
order by ver_no
the result will be something like this:
.1.3.1
.1.3.2.5.
.1.4.1.7.12
.1.4.11.14.7.
.1.4.3.109.1.
.1.4.8.66.
(anonymous) wrote:
How could I calculate differences of timestamps in a log-table?
Table log ( user_id integer, login boolean, ts timestamp )
So login = true would be a login-event and login = false a logout.
Is there a way to find the matching login/logout to
calculate the difference?
Leif Biberg Kristensen l...@solumslekt.org wrote:
UPDATE sources SET source_text = regexp_replace(source_text,
E'n=(.*?)$1(.*?)', E'n=\\1$2\\2', 'g') where source_text like
'%n=%$2%%';
Sorry, I pasted a literal replacement, and substituted the parameters by hand.
The expression should of
Leif Biberg Kristensen l...@solumslekt.org wrote:
On Saturday 17. September 2011 19.07.03 Tim Landscheidt wrote:
Leif Biberg Kristensen l...@solumslekt.org wrote:
UPDATE sources SET source_text = regexp_replace(source_text,
E'n=(.*?)$1(.*?)', E'n=\\1$2\\2', 'g') where source_text like
(anonymous) wrote:
I have to deal with a table which contains:
first_name
surname
email1
email2
... and I would like to create a view which combines both email columns thus:
first_name
surname
email
It looks simple but I can't think of an obvious query.
Try:
| SELECT first_name,
(anonymous) wrote:
[...]
I intend pass the number of the month(say 1 for January , 2 for February
etc) as the parameter to this method and return a number that corresponds
to the index of the month in the new order , say I pass 8 for August , I
return 11 , in order to get the index of
(anonymous) wrote:
there is a table that has among others a integer primary key
id and another integer column prio as well as an integer
group_id.
I'd like to invert the values of the prio-column for one of the groups.
The prio numbers start with 3 and there are 1159 different
prios in
Johann Spies jsp...@sun.ac.za wrote:
I am struggling a bit to do the following type of update in a table.
I want the content of a field updated like this:
Original:
'0894396e-16bf-4e63-aa52-97fe7031eec9||50a6b47c-f69c-414d-bcb6-14bbe403de5f|||'
After update:
(anonymous) wrote:
how can I remove a set of characters in text-columns ?
Say I'd like to remove { } ( ) ' , ; . : !
Of course I can chain replace ( replace ( replace ( replace
( ... , '' ) and replace the chars one by one against
an empty string ''.
There might be a more elegant
Gary Chambers gwch...@gmail.com wrote:
I've been provided a CSV file of parts that contains duplicates of
properties (e.g. resistors have a wattage, tolerance, and temperature
coefficient property) of those parts that differ by a manufacturer
part number. What I'd like to do is to process
Richard Huxton d...@archonet.com wrote:
What I want to get is the values grouped by subset, where a subset is a
set of rows with identical column until the colum changes.
Is there a way to get
| 2 | B |
| 4 | C |
| 4 | B |
| 3 | D |
by SQL only?
I think, the problem is that there are
Rainer Stengele rainer.steng...@diplan.de wrote:
yes, the date is always incremented - but anyway the date
column is not really the point! Actually the first tow
columns are relevant. I want them gouped together as
indicated, adding up column 1 in the blocks with identical
second column, but
Wes Devauld w...@devauld.ca wrote:
I believe I lost the flavour of what I'm doing when I constructed this
example. I'm not interested in the timepoint as much as the value that is
attached to it. I need to be able to find the last chronological record for
a given day.
I can get the value
(anonymous) wrote:
is there a way to find events in a log that happen within a
certain timespan to each other?
Log is like this
event_idinteger not null default 0 primary key
event_type_idinteger not null default
user_idinteger not null default 0
Jerrel Kemper jer...@s-wise.nl wrote:
My table consist off the following fields
CREATE TABLE test
(
id bigserial NOT NULL,
name character varying(100),
CONSTRAINT logs_pkey PRIMARY KEY (log_id)
)
with value :
IDName
1 001
201
3 1
411
Andrew Geery andrew.ge...@gmail.com wrote:
[...]
My questions are:
(A) Is there a way to check (2) above using a constraint and not a trigger?
(B) Is there an easier way to solve this problem? Does the complicated
nature of the solution make the design poor?
(C) Should I not worry about
Steven Dahlin pgdb.sldah...@gmail.com wrote:
I am attempting to generate a temporary function to execute some dml with
the following script:
create or replace function setuplicense() returns integer as $$
declare
hwcustid integer := 0;
retvalinteger := 0;
begin
insert into
John jo...@jfcomputer.com wrote:
I have a piece of python code that excutes a SQL statement:
apitempCur.execute(select * from jfcs_balancedue('%s') f(enrolleeid varchar,
course_cost decimal, paid_amt decimal) % (enrollIds,));
The enrollids is a list of primary keys and the jfcs_balancedue
Richard Broersma richard.broer...@gmail.com wrote:
I have a piece of python code that excutes a SQL statement:
apitempCur.execute(select * from jfcs_balancedue('%s') f(enrolleeid
varchar,
course_cost decimal, paid_amt decimal) % (enrollIds,));
The enrollids is a list of primary keys and
Jasen Betts ja...@xnet.co.nz wrote:
It looks like most of our tools are using the Perl version of regular
expressions with an upper limit of a bound being 32766. Is there any way to
change this in PG? Or can I change from POSIX to Perl?
perhaps you can do something in pl-perl?
posix
Michele Petrazzo - Unipex michele.petra...@unipex.it wrote:
I have two table that are so represented:
t1:
id int primary key
... other
t2:
id int primary key
t1id int fk(t1.id)
somedate date
... other
data t1:
1 | abcde
2 | fghi
data t2:
1 | 1 | 2010-05-23
2 | 1 | 2010-05-24
3
Louis-David Mitterrand vindex+lists-pgsql-...@apartia.org wrote:
I have this function which swaps primary keys for cabin_types (so that
id_cabin_type ordering reflects natural data ordering):
CREATE OR REPLACE FUNCTION swap_cabin_types(id1 integer, id2 integer)
RETURNS integer
Louis-David Mitterrand vindex+lists-pgsql-...@apartia.org wrote:
you use something simple like (untested):
| UPDATE cabin_type
| SET id_cabin_type =
| CASE
| WHEN id_cabin_type = id1 THEN
| id2
| ELSE
| id1
| END
| WHERE id_cabin_type
Brian Modra br...@zwartberg.com wrote:
It works using 'now' and I assume that since curtime is
of type DATE that the assignment casts the return automatically
to type DATE. Thank you for the ideas.
[...]
What's wrong with Pavel's correct and to-the-point answer?
No need actually to
Kenneth Marshall k...@rice.edu wrote:
It works using 'now' and I assume that since curtime is
of type DATE that the assignment casts the return automatically
to type DATE. Thank you for the ideas.
[...]
What's wrong with Pavel's correct and to-the-point answer?
Tim
--
Sent via pgsql-sql
Mark Fenbers mark.fenb...@noaa.gov wrote:
I am using psql's \copy command to add records to a database
from a file. The file has over 100,000 lines.
Occasionally, there is a duplicate, and the import ceases
and an internal rollback is performed. In other words, no
data is imported even if
Leif Biberg Kristensen l...@solumslekt.org wrote:
[...]
So far, so good. But when I try to do the actual expansion, I'm stumped.
pgslekt= select regexp_replace((select source_text from sources where
source_id=23091), (select quote_literal(short_link) from short_links where
link_type =
Feixiong Li feixion...@gmail.com wrote:
I am newbie for sql, I have a problem when using max()
function, I need get null when there are null in the value
list, or return the largest value as usual, who can do
this?
i.e. max([1,2,3,4,5]) = 5
max([1,2,3,4,5,null]) = null
You can cheat a
Louis-David Mitterrand vindex+lists-pgsql-...@apartia.org wrote:
Here is the basic schema:
--id_ship---
||
[SHIP]-id_ship-[CABIN]-id_cabin-[PRICE]-id_cruise-[CRUISE]
It's a database of
Shruthi A shruthi.i...@gmail.com wrote:
Thanks people, but the trigger doesnt really solve my problem. You see,
there is actually a CHAIN of dependencies where B references A, C references
B, D and E reference C and so on... So if i start writing triggers for all
these, there'll be a huge
Louis-David Mitterrand vindex+lists-pgsql-...@apartia.org wrote:
Here is my schema:
cruise_line - ship(id_line) - cruise_type(id_ship) - cruise(id_cruise_type)
- price(id_cruise, id_currency) - currency (USD,GBP,EUR,CAD)
(a 'cruise' is a 'cruise_type' + a date)
I am trying to
Shruthi A shruthi.i...@gmail.com wrote:
I have 2 tables (A and B) where the table B has a foreign key reference to
table A. Like this:
create table A (x int primary key);
create table B (y int primary key, z int references A (x) );
As you can see, i've not specified any further 'on
Brian Sherwood bds...@gmail.com wrote:
I am looking to play around with the postgres XML functions, but can't
seem to find a way to load my data.
I have a number of XML files: file1.xml, file2.xml, etc All files
follow the same xml format (DTD?)
I would like to create the following
Michael Gould mgo...@intermodalsoftwaresolutions.net wrote:
Based on what I read it wouldn't handle cases where the result should be
MacDonald from macdonald. There are other cases such as the sentence below
('it''s crazy! i couldn''t believe kate mcdonald, leo dicaprio, (terrence)
trent
Thom Brown thombr...@gmail.com wrote:
[...]
Having a look around, it looks as if Postgres might be misbehaving.
According to this page,
http://my.safaribooksonline.com/0596004818/sqlnut2-CHP-4-SECT-3, the ORDER
BY in the window function's clause shouldn't be having this ordering effect:
Jan Verheyden jan.verhey...@uz.kuleuven.ac.be wrote:
Thanks for the suggestion, the only problem is, if primary key is used then
each row should be unique what is not true; since I have a column
'registered' what only can be 1 or 0...
[...]
I have no idea what you are trying to say.
Tim
Relyea, Mike mike.rel...@xerox.com wrote:
The goal is, where uid not equals to 'janvleuven10' a new
record should be inserted with the uid, and registered=0
So if a record is found you want to update it and if a record isn't
found you want to insert it. I think you'll probably want to use
Alvaro Herrera alvhe...@commandprompt.com wrote:
It's on Windows
I'd go with notify and a listener written in C using c-client to send
emails, but only because I've used those before.
I wouldn't write it in C but rather Perl or Python, but whatever suits
your fancy should work (Visual
(anonymous) wrote:
Any ideas on how to achieve this? I would like to let the original sql
code stay original. I can prepare postgres before executing the sql if
this makes it easier to acheive the goal
Have a look at CREATE RULE.
Ok, you mean I could create a rule for the table, then I
(anonymous) wrote:
I have a problem where I want to tweak a simple select in an
unobtrusive way. Imagine I have the following select statement:
SELECT name FROM customer LIMIT 1 and I get a normal result set from
this. But, could I,maybe by defining some other function or similar,
change the
Hi,
I'm trying to check whether a given string is part of an
XPath result set. I have encountered some performance prob-
lems in the process, but before I track those down further,
I'd like to see if I've chosen the right path to begin with:
| SELECT * FROM $TABLE
| WHERE $COLUMN =
48 matches
Mail list logo