OCOMMIT
\set AUTOCOMMIT FALSE
begin;
But this works only one transaction.
regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Tel. NL Heynitz: 035242/47212
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Untern
select id, sum(summe) from (select id, sum(quantity) as summe from tbl3 where
order_id in (select order_id from tbl2 where closed = false) group by id union
select id,0 from tbl1 group by id) as x group by x.id order by x.id;
and this result:
id | sum
--+-
AB12 | 15
CD34 | 5
average.
>
> should I create an index to speedup the counts or not ?
Yes.
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Tel. NL Heynitz: 035242/47212
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
-
d'
test-# when fruit = 2 then 'bad'
test-# when fruit = 3 then 'rotten' end from fruit;
name | fruit | case
+---+
Apple | 1 | good
Banana | 2 | bad
Cherry | 3 | rotten
(3 Zeilen)
Please read
http://www.postgresql.org/docs/7.4/interactive
and 'rotten' under the column 'fruit'?
Yes, simple:
test=# select name, case
test-# when fruit = 1 then 'good'
test-# when fruit = 2 then 'bad'
test-# when fruit = 3 then 'rotten' end as fruit from fruit;
name | fruit
----+----
Apple
am 16.12.2004, um 8:10:25 -0600 mailte Bruno Wolff III folgendes:
> On Thu, Dec 16, 2004 at 12:01:39 +0100,
> Andreas Kretschmer <[EMAIL PROTECTED]> wrote:
> > >
> > > considering that almost 70% of the rows will be with 'VALUE1', 20%
> > > w
am 26.01.2005, um 10:13:52 +0200 mailte Din Adrian folgendes:
> Hello,
> I am want to use a private table in postgresql(every client to see his own
> data).
> Is this possible? How can I do it!
Why?
You can create different users and/or different databases.
Regards, Andreas
rently the context on DB bbb?
Yes, take a look at dblink (contrib-package)
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
--
atches(smiles,smarts))::numeric,2)
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
---(end of broadcast)
linux-gnu, compiled by GCC i386-linux-gcc (GCC)
3.3.5 (Debian 1:3.3.5-5)
(1 Zeile)
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
--
am 06.04.2005, um 13:55:35 +0700 mailte bandeng folgendes:
> hello guys,
>
> I want to use crosstab function but that function it doesnt exist. my
> version is 7.3 so how do i get the tablefunc.sql from postgre contrib?
apt-get install postgresql-contrib
Regards, Andreas
he pg_hba.conf. Read this about -i and TCPIP_SOCKET and
edit this to enable access via tcp/ip.
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
--
a file for
> the sql instructions but right on the same line. I use very short psql
> commands and would like to do it all with 1 file.
echo "select bla from fasel" | psql -U database
You can also use here documents, shell-variables and so on.
Regards, Andreas
--
Andreas Kre
i'm using 7.4.6.
Is there now a way to get the total number of rows in a CURSOR?
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
-
trib on dblink.
You should look in the archiv of the list, Tom Lane and other people
described the way with dblink in the past.
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas
erent db site. Tq in
> advance.
1. write your own client thats connect to several databases
2. use dblink, this is part of the contrib-distribution
Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp
his should solve your perfomance-problem.
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
---
am 22.05.2005, um 10:17:53 +0200 mailte Andreas Kretschmer folgendes:
> > can you help me how to fix them.
> > Can I using function to fix them (how?)
>
> It is possible to create a extra table for the balance and a trigger for
> insert/update that calculates the balance
ENT_DATE;
date
2005-05-23
(1 Zeile)
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
--
0
2005-05-23
(2 Zeilen)
test=# select * from datediff where CURRENT_DATE - start > 10;
start
1966-08-30
(1 Zeile)
test=# select * from datediff where CURRENT_DATE - start < 10;
start
2005-05-23
(1 Zeile)
Btw.: please no TOFU, read http://en.wikipedia.org/wi
am 24.05.2005, um 17:59:31 -0300 mailte [EMAIL PROTECTED] folgendes:
> Hi.
> How can I delete the duplicated records with "DELETE FROM TABLE WHERE..."
> clause??
Please read http://www.gtsm.com/oscon2003/deletetid.html
Its a very good article about this problem.
Regards,
=# insert into blub values (1, 'x');
| INSERT 970706 1
| test_db=# insert into blub values (1, 'y');
| FEHLER: duplizierter Schlüssel verletzt Unique-Constraint >>blub_pkey<<
`
In other words: if there a primary key on the first row, you cannot
insert duplicates.
h a RULE or a TRIGGER.
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
===Schollglas Unternehmensgruppe===
---(end of broadcast)---
am 09.06.2005, um 3:29:15 -0500 mailte Bruno Wolff III folgendes:
> On Thu, Jun 09, 2005 at 09:18:09 +0200,
> Andreas Kretschmer <[EMAIL PROTECTED]> wrote:
> > am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes:
> > > hi
> > > i have a tab
195
>
>
> Select * from tbl_xxx where
> tbl_xxx.A2=substr('196895588454554545454',0,char_length(tbl_xxx.A2)+1);
Perhaps because char_length() returns NULL and this is a invalid value
for substr(). Use coalesce():
... substr('196895588454554545454',0,coalesce(ch
am 20.06.2005, um 11:45:55 +0200 mailte Luca Rasconi folgendes:
> I need to know if somebody read this mail.
Yes, i read it ;-)
Regards, Andreas
--
Andreas Kretschmer(Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.
-
> 7349453 | admintool |5436 | 100 | admintool | |
> 7349454 | postgres |5437 |1 | postgres | |
> (2 rows)
>
> But 'current_query' is still always empty... B-(
enable stats_command_string in your postgresql.conf
Re
brett <[EMAIL PROTECTED]> schrieb:
> Hi there
>
> This is my first posting here, please forgive me if I make any
> mistakes here.
>
> Ok
>
> I have the structure
>
> {CLIENTS} = Client ID, First Name, Surname, DOB, Address, Home Phone
> No, Mobile Phone No
>
> As one relation / table (There
Shavonne Marietta Wijesinghe <[EMAIL PROTECTED]> schrieb:
> I have 2 schemas "operativo" and "autore" and they both have a table "PECDT00"
>
> i want to create a function with the following sql command (using the
> programme
> pgadmin 3) in pgadmin 3 there is a small wizard to fill when u creat
Abdul Wahab Dahalan <[EMAIL PROTECTED]> schrieb:
> Hi everyone!
>
> I'm looking for solution to speed up the database query, means that to
> get resultset as quicker as we can.
09:41 < akretschmer> ??tuning
09:41 < rtfm_please> For information about tuning
09:41 < rtfm_please> see http://www.pow
alessandra de gregorio <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> What function should I use to get a serial number, together with my results,
> from a query?
>
> Ex. Of output I want:
>
> 1 ooo pp ij
> 2 hou joo iu
> 3 bhi ft yh
>
> Basically, I would l
[EMAIL PROTECTED] <[EMAIL PROTECTED]> schrieb:
> Hello all,
>
> I'm trying to create a schema that contains the default tables, functions,
> etc. of the public schema. Using pgAdmin, when I create a schema, it is blank
1. make a dump from the public-schema
2. edit the dump and change 'public' t
Andy Ballingall <[EMAIL PROTECTED]> schrieb:
> Hello Peter,
>
> I'm glad it's possible, but I can't see how from the documentation.
>
> Say if I have a table called 'apples' and a table called 'pears'.
>
> What would the rule look like that would remap all updates on apples so that
> they were
Andy Ballingall <[EMAIL PROTECTED]> schrieb:
> Hello Jaime,
>
> I'm still not quite clear.
>
> Say I have a number of different updates on a table 'apples' in my code,
> including:
>
> UPDATE apples set pips=6 and color='yellow' where id=3;
> UPDATE apples set size=10 where id=6;
>
> What woul
Andy Ballingall <[EMAIL PROTECTED]> schrieb:
> Hi Andreas,
>
> The rule you've given only works for an update which changes the name.
>
> If I do another update which changed the colour instead of the name, that
> rule wouldn't do the right thing.
Right.
> Instead, I'm looking for something w
frank church <[EMAIL PROTECTED]> schrieb:
> Hi guys,
>
> What is the command change database owner in PostgreSQL 7.4?
ALTER DATABASE foo OWNER TO blob;
In general: start psql and type '\h alter database', and, more general,
'\h' and '\?'
HTH, Andreas
--
Really, I'm not out to destroy Micros
Colton A Smith <[EMAIL PROTECTED]> schrieb:
> Hi:
>
>Let's say I have a table with a column of one-dimensional arrays. What
> exactly is returned when the database is queried for a maximum from that
> particular column? The array was the greatest average value? Let's say
What du you exp
Michael Avila <[EMAIL PROTECTED]> schrieb:
> I am not much of a SQL guru so I am having trouble trying to figure out how
> to format a SQL statement.
>
> I have a table with members named members. Each member has only 1 record.
> Then I have a table with member telephone numbers in it name
> memb
Richard Huxton schrieb:
> Now (upper_time - lower_time) is the interval you want and summing them
> will give you your answer.
>
> Any help?
Yes, thanks.
But, i remember a little function that i wrote in the past:
http://a-kretschmer.de/tools/time_intersect.sql
And now i have a solution (i h
Maciej Piekielniak <[EMAIL PROTECTED]> schrieb:
> Hello ,
>
> How can i modify few fields with alter?
>
> ALTER TABLE fv_wystawione
> ALTER id_fv SET DEFAULT nextval('id_fv_seq'::text),
> ALTER imie SET DEFAULT '';
test=# create table xyz (id int not null);
CREATE TABLE
test=# create sequ
Maciej Piekielniak <[EMAIL PROTECTED]> schrieb:
> Hello Andreas,
>
> Wednesday, February 15, 2006, 7:54:28 PM, you wrote:
> AK> test=# alter table xyz alter column id set default nextval('xyz_seq'),
> alter column foo set default '';
>
> PGAdmin-SQL:
>
> alter table xyz alter column id set def
ivan marchesini <[EMAIL PROTECTED]> schrieb:
> Dear users..
> I have fastly created a table in a postgresql database..
> some columns where edited by hand (columns A, B, C), and some others
> (columns D, E, F) have been calculated as a result of mathematical
> equation (where the factors are the A
AKHILESH GUPTA <[EMAIL PROTECTED]> schrieb:
> Hi All.!
> I just want to know one thing that is it possible with PGSQL that,
> if I want to insert and execute a query from a external text file instead of
> giving it at the pgsql prompt?
in psql, try simple "\i your_file.sql" to execute the
Jesper K. Pedersen <[EMAIL PROTECTED]> schrieb:
> Is it possible to use SQL to merge data into one result?
>
> A theorethical example to explain:
>
> tbl_test (
> id integer,
> information varchar(25))
>
> id | information
> ---+--
> 1 | Yo
> 2 | Go away
> 1 | Stay put
> 3 |
Emi Lu <[EMAIL PROTECTED]> schrieb:
> Hello,
>
> Is there a way that I can get the size of one array ?
Yes: http://www.postgresql.org/docs/8.1/interactive/functions-array.html
HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.
AKHILESH GUPTA <[EMAIL PROTECTED]> schrieb:
> hi all,
> below I have created two tables in pgsql with field name as 'name' and 'id' as
> their datatype 'varchar(15)' and 'integer'.
> i want the output as:->
... a UNION of this 2 tables:
test=# select * from test1 union select * from test3 orde
Sergey Levchenko <[EMAIL PROTECTED]> schrieb:
> http://www.postgresql.org/docs/8.1/interactive/sql-createtrigger.htmlSELECT
> does not modify any rows so you can not create SELECT triggers.Rules
> and views are more appropriate in such cases. On 4/14/06, A.
Oh yes, i'm sorry.
Andreas
--
Reall
Mark True <[EMAIL PROTECTED]> schrieb:
>
> Here is the question:
>
> I have a situation where I need to create triggers to cascade an insert
> operation to many tables to maintain foreign key constraints.
>
> So at a high level
>
> INSERT INTO myTable (Name, Address, Zip) VALUES ('Mark', '3 D
Mark True <[EMAIL PROTECTED]> schrieb:
> I guess I should have clarified. I am having trouble figuring out how to
> construct the IF statement to see if that item exists in the foreign table
> something like:
>
> count=select count(*) from table;
>
> if count=0 {
> insert fkey into myOtherTable
Mark True <[EMAIL PROTECTED]> schrieb:
> Next silly question, how do you get your database to like plpgsql...
- createlang on the command line
- create language plpgsql; (in psql)
>
> I do CREATE LANGUAGE 'plpgsql' and it says it is not defined?
Strange...
>
> --Mark
>
>
> On 4/18/06, AA
Markus Schaber <[EMAIL PROTECTED]> schrieb:
> Bitmap Index Scans can be your solution, but AFAIK they were invented in
> 8.1.
Right.
>
> For bitmap index scans, you have one index on fkColumnOne and one on
> fkColumnTwo, and the query planner knows to combine them when both
> columns are given i
[EMAIL PROTECTED] <[EMAIL PROTECTED]> schrieb:
> Hi Andreas and Markus,
>
> Bitmap indices sound like a good reason to go from 8.0 to 8.1. Is 8.2
> around the corner, by any chance?
IIRC in autumn/winter. If it is finish ;-)
>
> I searched PG docs to see if I need to do something special to c
MJ Santhosh <[EMAIL PROTECTED]> schrieb:
> I am not an expert in postgres, may this work for you.
>
> REVOKE INSERT,UPDATE,DELETE ON ALL from PUBLIC;
IIRC, you cant REVOKE ... ON ALL, you need a table-name instead ALL.
But, you can create a script for all tables:
http://people.planetpostgresql
Emi Lu wrote:
> Good morning,
>
> I have a currency table (code, description).
>
> Example values:
> ADF | Andorran Franc
> ... ...
> ANG | NL Antillian Guilder
> AON | Angolan New Kwanza
> AUD | Australian Dollar
> AWG | Aruban Florin
> BBD | Barbados Dollar
> USD | US Dollar
> CAD | Ca
msi77 wrote:
> Does PG support CTE?
Since 8.4 yes.
> You can try it.
Sorry, but i don't know how a CTE can help in this case, can you explain
that?
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (L
8q5tmky...@sneakemail.com <8q5tmky...@sneakemail.com> wrote:
> Hi,
>
> I have a two tables:
>
> article
> articleID, name, content
>
> tags
> articleID, tag
>
> I want to find all articles that are tagged with "a" but not "b"
>
> how do I do this?
select a.* from article left join tags t on
Gianvito Pio wrote:
> Hi all,
> is there a way (also strange) to define a trigger on a system table (for
> example on pg_class)?
No.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If
Gianvito Pio wrote:
> Hi all,
> is there a way to drop all constraints of a table?
>
> I found this workaround in the manual:
>
> CREATE TABLE temp AS SELECT * FROM distributors;
> DROP TABLE distributors;
> CREATE TABLE distributors AS SELECT * FROM temp;
> DROP TABLE temp;
I think, you can cha
A. Kretschmer wrote:
Well, and now i'm using 8.4 windowing-functions:
test=*# select * from price order by price_id, d;
price_id | price | d
--+---+
1 |10 | 2010-03-12
1 |11 | 2010-03-19
1 |12 | 2010-03-26
1 |13 | 2010-
Cliff Wells wrote:
> As far as I can see, INSERT INTO...RETURNING is semantically equivalent
> to SELECT...FROM with a side-effect, so it seems this construct should
> work. Can someone shed some light?
Well, at the moment you can't reuse the RETURNING-values, you have to
wait for 9.1, writeabl
John wrote:
> Hi,
> I'd like to learn the use of window functions and did not find a tutorial
> using google ("postgres window function tutorial"). I'm hoping someone has a
> link.
My link-collection: http://delicious.com/akretschmer/windowing and
http://delicious.com/akretschmer/cte
Andre
Edward W. Rouse wrote:
> Is there any way to remove a duplicate row from a table? Not my db but I have
> to work with it. On version 7.4 right now.
>
How to select the right records?
You can try to use the ctid-column, see my simple example:
test=# select * from dups ;
i
---
1
1
1
2
2
John Lister wrote:
> Hi, I was wondering if it is possible to do this with a single query rather
> than iterate over all of the rows in an application:
>
> I have a table which for brevity looks like:
> create table offers {
> integer id;
> integer product_id;
> double price;
> }
>
> wh
Emi Lu wrote:
> Hello,
>
> Is there a way to force the view column change from varhcar(32) to
> varchar(128)?
No, you have to recreate the view ...
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Li
Tony Capobianco wrote:
> Here's my table:
>
> plsql_dw=# \d tmpsv_parent_master
>Table "staging.tmpsv_parent_master"
>
> Why won't this work?
> plsql_dw=# select memberid || addeddate from tmpsv_parent_master limit
> 10;
> ERROR: operator does not exist: numeric || timestamp withou
Andrey Fokin wrote:
> Hi,
> please advise is possible in SELECT query use variable as a table name?
>
> I would like to have for example something like:
>
> CREATE OR REPLACE FUNCTION test_name (tb varchar) RETURNS int AS $$
>
> DECLARE
>
> ..
>
> BEGIN
>
Emi Lu wrote:
> Thank you for the info.
>
> I found a simple way:
> ==
> [1] create SEQUENCE tmp start 7820;
> [2]
> insert into desti_table_name
> select nextval('tmp'),
>c1, c2... ... cN
> from t1 left join t2... ... tn
> where ... ...
>
> Jus
Karl Koster wrote:
> I have a couple of questions regarding unnest.
>
> 1) If I issue a select statement "select unnest(vector1) as v from
> some_table", I cannot seem to use the column alias v in a WHERE or
> HAVING clause. I can use it in an ORDER BY or GROUP by clause. Is this
> the way
Leif Biberg Kristensen wrote:
> Can anybody tell me why this doesn't work?
>
> pgslekt=> CREATE SEQUENCE sources_source_id_seq START WITH (SELECT
> MAX(source_id) FROM sources);
> ERROR: syntax error at or near "("
> LINE 1: CREATE SEQUENCE sources_source_id_seq START WITH (SELECT MAX...
>
Leif Biberg Kristensen wrote:
> On Saturday 11. June 2011 22.09.09 Leif Biberg Kristensen wrote:
> > I've written a blog post which I hope may be helpful to others in a similar
> > situation:
> >
> > <http://solumslekt.org/blog/?p=321>
> >
> >
Andreas wrote:
> Hi,
> is there a clever way to check overlapping time intervals ?
> An option named n should be taken from date y to y.
> The same name is ok for another interval.
>
> e.g. table : mytab ( d1 date, d2 date, n text, v text )
>
> There should be a constraint to provide no row can
James Bond 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.
>
maya.more wrote:
> I have a table with Date and unit column. . I want to find sum of unit column
> considering 3 days each
>
> User will specify start and enddate
>
> Eg
>
> DateUnit
> 10/1/2011 1
> 10/2/2011 2
> 10/3/2011 3
> 10/4/2011 4
> 10/5/2011 4
> 10/6/
You can't do that in THAT way, but you can use dynamic SQL:
test=# select * from drop_role ;
t
foobar
(1 row)
test=*# do $$ declare r text; begin for r in select t from drop_role loop
execute 'drop role ' || quote_ident(r) || ';'; end loop; end; $$language
plpgsql;
DO
"Bric
Jan Peters wrote:
> Dear all,
> maybe a stupid question, but: I have a table that is ordered like this:
>
> user_id|timestamp|event
> 1 |0:1 |event_a
> 1 |0:2 |event_b
> 2 |0:1 |event_b
> 2 |0:3 |event_c
> 2 |0:4 |event_b
> 3 |0:1 |even
Richard Klingler wrote:
> Good day...
>
> I'm trying to build a query for PGSQL 9.1 where a table has two
> references with only one being used depending of the type of entry..
>
> For example, the table has following simplified structure:
>
> portid primary key
> port2no
Richard Klingler wrote:
> This seems to do the trick...
>
> select arp.ip, arp.mac, arp.port2time, arp.time, arp.hostname, arp.vlan
> from arp, port, node
> where
> arp.arp2port = port.portid and port.name = 'Fa1/0/1'
> and port.port2node = node.nodeid
> and node.name like 'no
Stefan Weiss wrote:
>
> - running this query -
>
> SELECT name
> FROM dossier_contact_v
> WHERE dossier_id = 56993
>AND ctype = 234
> UNION
> SELECT name
> FROM dossier_contact_v
> WHERE dossier_id = -1
>AND ctype = -1
> ORDER BY ctype;
>
>
Gabriel Filipiak wrote:
> Hi,
>
> so I am working on PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by
> gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 64-bit.
>
> It seems that i can't give a table name for example testTable it has to be
> test_table, because I can't access it via psql is t
vinodh chowdary wrote:
> Hi sir,
>
> i am using postgres as database for my project.
> i want to convert postgres data into excel sheet.
> is there any way to do it?
> please reply me.
This should be possible with ODBC.
(But i'm not familiar with it, don't ask me how ...)
Andreas
--
Really
rverghese wrote:
> I want to insert a bunch of records and not do anything if the record already
> exists. So the 2 options I considered are 1) check if row exists or insert
> and 2) ignore the unique violation on insert if row exists.
> Any opinions on whether it is faster to INSERT and then ca
Alok Thakur wrote:
> Dear,
>
> I am trying to provide you as much details as possible.
>
> answer` (
> `id` int(10) NOT NULL AUTO_INCREMENT,
> `question_id` int(10) NOT NULL,
> `user_id` int(10) NOT NULL,
> `answer` int(10) NOT NULL, ->
> `status` tinyint(1) NOT NULL, --> Status wil
John Fabiani wrote:
> Hi,
> I have read a few articles and I'm not sure if it's me or the authors but I
> do
> not believe my question was answered.
>
> If I have table that has a PK and a FK - will the planner use the FK just
> same
> as it would use the PK? IOW's is a FK also an index use
Rehan Saleem wrote:
> hi ,
> how can we concatinate these lines and execute sql command
>
>set sql = 'select user,username, firstname '
> set sql += ' lastname, cardno from table1 where userid=' + 5
sql = sql || ' bla fasel';
|| is the concat - Operator.
Andreas
--
Really, I
John Fabiani wrote:
> Hi,
> In my app it is possible to login as one name and use a different name to
> login to postgres.
>
> Is it possible to get the actual OS login name using plsql.
Since you can login to an remote database server: no.
Andreas
--
Really, I'm not out to destroy Micros
Emi Lu wrote:
> Good morning,
>
> May I know is there a simple sql command which could return missing
> numbers please?
>
> For example,
>
> t1(id integer)
>
> values= 1, 2, 3 500
>
> select miss_num(id)
> from t1 ;
something like
,[ code ]
| test=# select * from emi_lu ;
|
Raj Mathur (राज माथुर) wrote:
>
> Nice one, but curious about how would this perform if the numbers in
> question extended into 7 figures or more?
TIAS
(Try It And See)
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.
Marcel Ruff hat am 4. Mai 2012 um 12:25 geschrieben:
> Hi,
>
> is an alias name not usable in the where clause?
Exactly.
Andreas
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
Jan Bakuwel hat am 21. Mai 2012 um 01:17
geschrieben:
> Hi,
>
> I'm trying to get my head around the following question. As an example
> take a table with products:
>
> productid (pk)
> name
>
> and productprice
>
> productpriceid (pk)
> productid (fk)
> pricedate
> price
>
> There are multipl
Andreas wrote:
> Hi,
>
> is there a way to limit access for some users only to certain records?
>
> e.g. there is a customer table and there are account-managers.
> Could I limit account-manager #1 so that he only can access customers
> only acording to a flag?
Yea, it's possible.
Write funct
Andreas wrote:
> Hi,
>
> I've got a log-table that records events regarding other objects.
> Those events have a state that shows the progress of further work on
> this event.
> They can be open, accepted or rejected.
>
> I don't want to be able to insert addition events regarding an object X
Andreas Kretschmer wrote:
> Andreas wrote:
>
> > Hi,
> >
> > I've got a log-table that records events regarding other objects.
> > Those events have a state that shows the progress of further work on
> > this event.
> > They can be open, accept
Marc Mamin wrote:
> >
> > Or this one:
> >
> > test=*# create unique index on log((case when state = 0 then 0 when
> > state = 1 then 1 else null end));
> > CREATE INDEX
> >
> >
> > Now you can insert one '0' and one '1' - value - but no more.
>
> Hi,
>
> A partial index would do the same,
Tom Lane wrote:
> Wayne Cuddy writes:
> A less bogus way of doing things is to use an EXCLUDE constraint,
> although that will restrict you to be running PG 9.0 or newer. You
> also need some way of representing the ranges as indexable objects.
> In 9.0 or 9.1, probably the best way is to use c
amit sehas wrote:
> In SQL, given a table T, with two fields f1, f2,
>
> is it possible to create an index such that the same record is indexed
> in the index, once with field f1 and once with field f2. (I am not
> looking for a compound index in which the key would look like f2>, instead the
BACHELART PIERRE (CIS/SCC) wrote:
> Hello,
>
>
>
>
>
> Why is my sql below accepted in 8.1.19 and refused in 8.4.9 ???
>
> Welcome to psql 8.1.19, the PostgreSQL interactive terminal.
>
> ansroc=# select * from s12hwdb where record ~'2012-09-20' limit 5;
>
>
> psql (8.4.9)
>
>
> ERR
Matthias Nagel hat am 29. September 2012 um 12:49
geschrieben:
> Hello,
>
> is there any way how one can store the result of a time-consuming calculation
> if this result is needed more than once in an SQL update query? This solution
> might be PostgreSQL specific and not standard SQL compliant.
Thomas Kellerer hat am 29. September 2012 um 16:13
geschrieben:
> Matthias Nagel wrote on 29.09.2012 12:49:
> > Hello,
> >
> > is there any way how one can store the result of a time-consuming
> > calculation if this result is needed more
> >than once in an SQL update query? This solution might
Anton Gavazuk wrote:
> Hi dear community,
>
> Have probably quite simple task but cannot find the solution,
>
> Imagine the table A with 2 columns start and end, data type is date
>
> start end
> 01 dec. 10 dec
> 11 dec. 13 dec
> 17 dec. 19 dec
> .
>
> If I have inter
Andreas Kretschmer wrote:
> Anton Gavazuk wrote:
>
> > Hi dear community,
> >
> > Have probably quite simple task but cannot find the solution,
> >
> > Imagine the table A with 2 columns start and end, data type is date
> >
> > start
1 - 100 of 144 matches
Mail list logo