Kaleeswaran Velu wrote:
> Hi Team,
> I am using PostgreSQL 9.2.3 in Windows platform. I have created two databases
> in it. Now I want to refer the tables across the databases. Meaning would like
> to create Database link. Can anyone guide me on how to create a DB link?
You can use db_link, see
Sofer, Yuval wrote:
> Hi,
>
>
>
> I am using Postgres DB with stand by database, configured with streaming in
> synchronized mode (each commit on primary DB waits for commit on secondary
> DB).
>
>
>
> Sometimes we suffer from network issues and as consequences, secondary machine
> is no
Andreas hat am 17. Februar 2013 um 18:02 geschrieben:
> Hi,
>
> I need to store data that has a valid timespan with start and enddate.
>
> objects ( id, name, ... )
> object_data ( object_id referencs objects(id), startdate, enddate, ... )
>
> nothing special, yet
>
> How can I have PG reject a
JORGE MALDONADO hat am 24. Dezember 2012 um 17:30
geschrieben:
> I have a record with the following fields:
>
> id1, id2, id3, id4, price1, price2, price3, price4
>
> I would like to write a SELECT statement in order to get 4 records:
>
> id, price (record that comes from id1 and price 1)
> id,
gt; 12 | 23434 | 0.88764543364566 |0 *M
> 33 | 23434 | 0.23235478697988 |1 *m/M
> 14 | 129007 | 0.63454675634756 |0 *m
> 19 | 129007 | 0.97897897897654 |0 *M
> 13 | 129007 | 0.22345364656788 | 1 *m
> 11 | 129007 | 0.867878
sorry, only a private replay and not to the list
-- Ursprüngliche Nachricht --
Von: Andreas Kretschmer
An: Antonio Parrotta
Datum: 28. Dezember 2012 um 15:19
Betreff: Re: [SQL] sql basic question
Hi,
your question was: "What I want to achieve is a result table with min an
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
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
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
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.
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
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
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
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,
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
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 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
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
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
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.
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 ;
|
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
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,
> 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
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
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
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
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
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;
>
>
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
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
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
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
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/
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.
>
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
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>
> >
> >
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...
>
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
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
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
>
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
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
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
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 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
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
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-
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
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
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
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
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
DM wrote:
> Hi All,
>
> I have a table test with columns name and value
>
> test table
> name
> value
>
> It has around 500 rows.
>
> I added a new column id to the table,
>
> Table test
> id,
> name,
> value
>
> I am not sure how to insert numbers to my column id (1-500).
You can cr
Carol Cheung wrote:
> Hi,
> I have a table called temp
>
> access_date | active | status
> -++
> 2009-02-01 | t | 15
> 2009-02-01 | f | 16
> 2009-02-02 | f | 17
> 2009-02-01 | t | 17
> 2009-02-02 | f | 21
> 2009-
Havasvölgyi Ottó schrieb:
> Hi,
>
> Let's assume I have a table (called tbl) with a column 'name' and an index on
> it.
> How to optimally find records whose name column begins with - say - "Pre"?
> I know it can be done with LIKE (WHERE name LIKE 'Pre%'), but will this use
> the
> index mentio
Scott Marlowe <[EMAIL PROTECTED]> schrieb:
> >> You can use a subquery like my example:
> >>
> >> test=*# select i, comma(t) from (select distinct i,t from foo) bar group
> >> by i;
> >> i | comma
> >> ---+-
> >> 1 | a, b, c
> >> (1 row)
> >>
> >> Time: 0.554 ms
> >> test=*# select i, c
Louis-David Mitterrand <[EMAIL PROTECTED]> schrieb:
>
> But if I append this
>
>order by pt.type_fr = 'comédien';
>
> I get this error:
>
> ERROR: column "pt.type_fr" must appear in the GROUP BY clause or be
> used in an aggregate function
>
> It seems I am using pt.type_fr in
Tk421 <[EMAIL PROTECTED]> schrieb:
>I've got a problem with a function: It receives two parameters, the
> first, the table name, and the second, a where condition. The function
> looks like this:
>
>DECLARE
> cod bigint;
> query TEXT;
>
>BEGIN
> query = 'SELECT co
Nacef LABIDI <[EMAIL PROTECTED]> schrieb:
> Hi all,
>
> I am writing some functions with retrun type as a SETOF of a datatype that I
> have defined. How can I test them with a select statement.
> Doing select my_function(); return set valued function called in context that
> cannot accept a set
Patrick Scharrenberg <[EMAIL PROTECTED]> schrieb:
> Something like this
> select a, b , a*b as c from ta where c=2;
>
> But postgresql complains, that column "c" does not exist.
>
> Do I have to repeat the calculation (which might be even more complex
yes.
Andreas
--
Really, I'm not out to de
Patrick Scharrenberg <[EMAIL PROTECTED]> schrieb:
> Hi!
>
> I have a table where I repeatingly log the status of some service, which
> looks something like this:
>
> < timestamp, status >
>
>
> I'd like to merge this information to intervals where the service was up
> or down.
>
>
Philippe Lang <[EMAIL PROTECTED]> schrieb:
2 ways:
* You can use something like this:
test=*# select * from a;
id | val
+-
1 | foo
2 | bar
(2 rows)
test=*# select array_to_string(array(select val from a), ', ');
array_to_string
-
foo, bar
(1 row)
* comma-aggrega
Stefan Scheidegger <[EMAIL PROTECTED]> schrieb:
> An example to explain my Problem: Lets say I have a table containing
> information about the customer (name, address, ...) and about his
> order (pieces, product-name, price). Because one customer can order
> several products I split the table into
Sabin Coanda <[EMAIL PROTECTED]> schrieb:
> Hi there,
>
> Is it possible to execute a system command from a function ? (e.g. bash )
Yes, of course, but you need an untrusted language like pl/perlU oder
plsh. http://plsh.projects.postgresql.org/
Andreas
--
Really, I'm not out to destroy Micros
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Andreas Kretschmer wrote on 28.10.2007 12:42:
> >>I have a column with the datatype "text" that may contain leading
> >>whitespace (tabs, spaces newlines, ...) and I would like to remove them
> >>all
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I have a column with the datatype "text" that may contain leading
> whitespace (tabs, spaces newlines, ...) and I would like to remove them all
> (ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' fr
Markus Schaber <[EMAIL PROTECTED]> schrieb:
> > is there any way to get both results in a single query,
> > eventually through stored procedure?
> > The retrieved [count(*),A] ; [count(*),B)] data couldnt fit
> > on a single table, of course.
> >
> > The main goal would be to get multiple results
Tore Lukashaugen <[EMAIL PROTECTED]> schrieb:
> Hello all,
>
> I have an application running against my postgres 8.2 database (on Windows
> Vista) for which I do not have access to the source code.
>
> I would like to know what SQL statements are being executed by the
> application. Is there a
Andreas Joseph Krogh <[EMAIL PROTECTED]> schrieb:
> Hi all. Any hint on how to format this interval as number of hour/seconds etc?
> select age('2007-09-22 17:00'::timestamp, '2000-02-20 18:00'::timestamp);
> age
> ---
> 7 years 7 mons 1 day 23:00:00
You
Stefan Arentz <[EMAIL PROTECTED]> schrieb:
> I need to get statistics from a bunch of tables. Simply the number of
> records in them.
>
> The query plan looks like this:
>
> => explain select count(id) from stuff;
> QUERY PLAN
> ---
John Gunther <[EMAIL PROTECTED]> schrieb:
> I've tried everything I can think of here to join records when the join
> table varies and is named in the primary record, but to no avail. Here's an
> example with all non-essentials stripped out.
>
> I have 3 tables:
>
> create table zip (
> id se
Stefan Zweig <[EMAIL PROTECTED]> schrieb:
> hi list,
>
> currently i am switching from mysql to pgsql, so i am a bit new to
> postgres' syntax.
You are welcome.
>
> at the moment i am looking in postgres for something which is similar
> to SHOW INDEX FROM [table] in mysql. unfortunately i coul
Karthikeyan Sundaram <[EMAIL PROTECTED]> schrieb:
>
> Hi,
>
> I am having a requirement here.
>
> 1) I need to write a plpgsql function where it takes the input
> parameter of a structure of a table.
Because? To build this table? You can pass an ascii-text
Gerardo Herzig <[EMAIL PROTECTED]> schrieb:
> Thanks! But now i have another problem related with count():
>
> select page_id, word, word_position, count(page_id) from (select * from
> search_word('word1', 'table1') union search_word('word2', 'table2')) foo
> group by page_id;
>
> and gives me
Pablo Barrón <[EMAIL PROTECTED]> schrieb:
>
> Hi!
>
> I'm trying to order a list in which the first parameter to order is a
> specific
> field, and the second should vary depending on a specific condition. More
> explicit, I would like to do something like:
>
> - ORDER BY a.column1, [b.colu
chester c young <[EMAIL PROTECTED]> schrieb:
> trying to do something like
>
> select d.day,
>c.name
> from [dates between day1 and day2] d
> left join c.some_table;
>
> but cannot figure out what to put into the brackets.
Perhaps something like this:
test=# select curre
Richard Broersma Jr <[EMAIL PROTECTED]> schrieb:
> --- Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote:
>
> > Thank you but I must inc an specific row. How to do that ?
> >
>
> Does,
>
> UPDATE your_table
> SET your_row = your_row +1
> WHERE your_pkey = ;
>
> not do what you need?
I th
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Thank you but I must inc an specific row. How to do that ?
Read the answer again.
Please, no silly TOFU (german synonym for text above, fullquote below).
> >> For example. I have a table with a field that on each update it
> >> incremen
Louis-David Mitterrand <[EMAIL PROTECTED]> schrieb:
> ballet,etc.) and I am looking for a select that can return the 10 last
> entered shows AND at most 2 of each type. Is that possible in one query?
A similar question i found in the archive and there are a couple of
answers: (for the second par
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> I mean really deadlock. Other transactions can't access the database until the
> main transaction is complete. A question:
That's not true.
>
> PostgreSQL doesn't permit multiple transactions concurrently ?
Why not? Show us a complete
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Hi list,
>
> Here in my country (Brazil) we have the decimal simbol as ' , ' (commas) and
> thousand separator as ' . ' (point)
>
> Here my sql uses: to_char(sum(My_column), '0D00')
>
> Is there any way to make this happens ?
I t
Jeff Herrin <[EMAIL PROTECTED]> schrieb:
> I am returning results ordered randomly using 'order by random()'. My issue
> has
> to do with page numbers in our web application. When I hit the 2nd page and
> retrieve results with an offset, ordering by random() isn't really what I want
> since I wil
Adrian Klaver <[EMAIL PROTECTED]> schrieb:
> On Thursday 23 November 2006 08:45 pm, Tom Lane wrote:
> > Mulham freshcode <[EMAIL PROTECTED]> writes:
> > > execute sql_str1 into svc_data_rec ;
> > >
> > > svc_data_rec is a RECORD, which is supposed to be dynamic.
> >
> > This should work --- in PG
Richard Broersma Jr <[EMAIL PROTECTED]> schrieb:
> > Hi guys,
> >
> >Am new to sql scripting so this might be a stupid question. Am getting
> > an error while trying
> > to do the following
> >
> > SELECT INTO svc_data_rec * from svc_tbl_name where 'uid' = sub_id;
> >
> > where svc_data_
ivan marchesini <[EMAIL PROTECTED]> schrieb:
> .
> or it depend on the fact I'm using postgres 7.4.13
> many thanks...
Maybe, the information-schema can be different in different versions.
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional sid
ivan marchesini <[EMAIL PROTECTED]> schrieb:
> Dear all...
> I have created a check constraint without giving it a name..
> now I have a check named "$25" in my table that I need to drop or
> modify!!!
> How can I do???
Can you see the name with \d within psql?
An example:
test=# create table
Felix Zhang <[EMAIL PROTECTED]> schrieb:
> Hi all,
>
> I'm a newbie of PostgreSQL. I'm searching materials about porting from Oracle
> to PostgreSQL.
> Anyone can share with me some good documatations?
http://techdocs.postgresql.org/#convertfrom
Andreas
--
Really, I'm not out to destroy Micr
Felix Zhang <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I want to split a table to 2 small tables. The 1st one contains 60% records
> which are randomly selected from the source table.
> How to do it?
Why do you want to do this?
Andreas
--
Really, I'm not out to destroy Microsoft. That will just
Judith <[EMAIL PROTECTED]> schrieb:
> Hello everybody!! I have a field type text with folios like this:
> A98526
>
> but I want to change de A for a 0 like this: 098526, exists a way to do
> this in a query???
Perhaps something like this:
test=# select regexp_replace('A98526', '
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb:
> Hi list,
>
> It is possible to retrieve the MAC Address of a computer using a Postgresql
> function like others:
In the same subnet? Then you can use untrusted languages such as plperlu
or plsh to retrieve the MAC for a IP. (arp -a ip)
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
[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
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
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
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:
>
> 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
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
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
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.
1 - 100 of 144 matches
Mail list logo