Samuel Smith wrote
> I noticed that I could get very nice partition elimination using
> constant values in the where clause.
>
> Ex:
> select * from
> where
>
> between '2015-01-01' and
> '2015-02-15'
>
> However, I could not get any partition elimination for queries that did
> not have
Steven Erickson wrote
> My problem now is that SELECTs scan all child tables
And what do these SELECTs look like - specifically the WHERE clauses?
David J.
--
View this message in context:
http://postgresql.nabble.com/Constraints-and-inheritance-tp5840715p5840716.html
Sent from the PostgreS
Vick Khera wrote
> On Fri, Mar 6, 2015 at 5:59 AM, pinker <
> pinker@
> > wrote:
>
>> I have deleted a large number of records from my_table, which originally
>> had
>> 288 MB. Then I ran vacuum full to make the table size smaller. After this
>> operation size of the table remains the same, desp
Eli Murray wrote
> Basically, what we'd like to do is create a serial primary key but instead
> of having it increment every row, it needs to check the name and total
> salary columns and only increment if that person doesn't already exist.
So you already have a PK, (Name, Total Salary), but the s
On Tue, Mar 10, 2015 at 8:20 AM, Andrzej Pilacik
wrote:
> I see the issues that this person might be having. I am not doing a
> restore or working on an existing issue.
>
> My setup is very vanilla, anyone can create these tables and test, will
> get the same permission error... (I did it in a
On Fri, Mar 13, 2015 at 12:18 PM, Jason Dusek wrote:
> Hi All,
>
> The difference in how format handles `regclass` and `name` seems like an
> inconsistency:
>
> WITH conversions(casts, format, result) AS (
> VALUES (ARRAY['name']::regtype[], '%I', format('%I',
> name('select')
On Saturday, March 14, 2015, Jason Dusek wrote:
> It honestly seems far more reasonable to me that %s and %I should do
> the exact same thing with regclass. My reasoning is as follows:
>
> ‘%I’ formats a something such that it is a valid identifier,
>
> regclass is already a valid identifier,
>
>
On Sat, Mar 14, 2015 at 8:29 AM, Tom Lane wrote:
> Jason Dusek writes:
> > It honestly seems far more reasonable to me that %s and %I should do
> > the exact same thing with regclass.
>
> You're mistaken. The operation of format() is first to convert the
> non-format arguments to text strings,
On Sunday, March 15, 2015, Tom Lane wrote:
> "David G. Johnston" > writes:
> > IOW, as long as the output string matches: ^"(?:"{2})*"$ I do not see
> how
> > it is possible for format to lay in a value at %I that is any more
> > insecure tha
On Sunday, March 15, 2015, Robert James wrote:
> How do I calculate the sum of a field filtered by multiple windows
> defined by another field?
>
> I have table event with fields event_date, num_events, site_id. I can
> easily use aggregate SQL to do SELECT SUM(num_events) GROUP BY
> site_id.
>
>
On Mon, Mar 16, 2015 at 11:50 AM, Marc Watson
wrote:
> Hello all,
> I am using PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 64-bit, as
> downloaded from EnterpriseDB, and is running on my dev system under Win 7
> 64-bit.
>
[...]
>
> However, when I combine the two queries into one, th
psql "$SERVICE" \
--echo-queries \
--set=string_input="${1:-ok_to_return}" \
--set=start="${2:-5}" \
--set=end="${3:-10}" \
<<'SQL'
SELECT idx
FROM generate_series(1, 20) gs (idx)
WHERE 'short-circuit' != :'string_input'
AND idx BETWEEN :start AND :en
On Mon, Mar 16, 2015 at 2:51 PM, Andy Colson wrote:
> On 3/16/2015 4:45 PM, Andy Colson wrote:
>
>> On 3/16/2015 4:30 PM, David G. Johnston wrote:
>>
>>> psql "$SERVICE" \
>>> --echo-queries \
>>> --set=string_inp
On Mon, Mar 16, 2015 at 3:13 PM, Adrian Klaver
wrote:
> On 03/16/2015 02:57 PM, Israel Brewster wrote:
>
>> I have a table with two timestamp columns for the start time and end
>> time of each record (call them start and end).I'm trying to figure out
>> if there is a way to group these records by
On Mon, Mar 16, 2015 at 4:16 PM, Israel Brewster
wrote:
> On Mar 16, 2015, at 2:22 PM, David G. Johnston
> wrote:
>
>
> On Mon, Mar 16, 2015 at 3:13 PM, Adrian Klaver
> wrote:
>
>> On 03/16/2015 02:57 PM, Israel Brewster wrote:
>>
>>> I have a tabl
On Monday, March 16, 2015, Alvaro Herrera wrote:
> David G. Johnston wrote:
>
> > Thanks! I got the gist even with the typo. I actually pondered about
> > prepare/execute after hitting send. Am I correct in remembering that
> > "CREATE TEMP TABLE" cannot be
On Tuesday, March 17, 2015, Israel Brewster wrote:
>
>
> > On Mar 17, 2015, at 8:09 AM, Paul Jungwirth > wrote:
> >
> >>> test=> select h, count(*) from start_end, generate_series(0, 23) as
> s(h) where h between extract(hour from start_time) and extract(hour from
> end_time) group by h order by
On Wednesday, March 18, 2015, WadeDare4703 wrote:
> I don't understand. What is wrong with having a schema which holds no
> data? Schemas are cheap.
>
> --
> *From: *"Tim Uckun" >
> *To: *"pgsql-general" >
> *Sent: *Wednesday, March 18, 2015 6:56:55 PM
> *Subject:
On Wednesday, March 18, 2015, John R Pierce wrote:
> On 3/18/2015 7:20 AM, adityagis wrote:
>
>> I have lots of data in my DB. I need to do archeiving and purging of my
>> data.
>> Can anyone please help me with step by step riles?
>>
>
> like this?
>
> select * from table where datefield < cur
On Mon, Mar 16, 2015 at 9:31 PM, David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Monday, March 16, 2015, Alvaro Herrera
> wrote:
>
>> David G. Johnston wrote:
>>
>> > Thanks! I got the gist even with the typo. I actually pondered about
>> &
On Thu, Mar 19, 2015 at 12:43 PM, Alvaro Herrera
wrote:
> David G. Johnston wrote:
>
> > Except that server "COPY" only is documented to accept a "query" that
> > begins with either SELECT or VALUES :(
> >
> > I hereby voice my desire for EXECU
On Thu, Mar 19, 2015 at 12:46 PM, David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Thu, Mar 19, 2015 at 12:43 PM, Alvaro Herrera > wrote:
>
>> David G. Johnston wrote:
>>
>> > Except that server "COPY" only is documented to accept a
On Tuesday, March 24, 2015, Bankim Bhavsar wrote:
> Hello postgres experts,
>
> We are running a test that periodically abruptly kills postgres
> process(equivalent to kill -9) and restarts it.
> After running this test for 24 hrs or so, we see duplicate primary key
> entries in postgres table.
>
On Wed, Mar 25, 2015 at 5:25 PM, Lavrenz, Steven M
wrote:
> Alright everyone, this is a doozy of a problem. I am new to Postgres so
> I appreciate patience/understanding. I have a database of hardware objects,
> each of which has several different “channels”. Once per day, these
> channels are s
On Wed, Mar 25, 2015 at 8:57 PM, Mitu Verma wrote:
> Hi,
>
>
>
> We have a customer complaining about the time taken by one of the
> application scripts while deleting older data from the log tables.
>
> During the deletion, customer reported that he often sees the below error
> and because of w
On Wed, Mar 25, 2015 at 8:58 PM, Mitu Verma wrote:
> Correcting the subject
>
And this is why it is considered good form to do "compose new message"
instead of replying to an existing one. Injecting your new topic into an
existing unrelated mail thread is mildly annoying.
David J.
On Fri, Mar 27, 2015 at 3:41 AM, Vincent Veyron wrote:
> On Thu, 26 Mar 2015 00:25:09 +
> "Lavrenz, Steven M" wrote:
>
> > I have a second table (TABLE B) with all of the object_ids and channels
> that are supposed to be reporting in each day. For cases where a certain
> channel does not che
On Fri, Mar 27, 2015 at 11:31 AM, Jan de Visser wrote:
> On March 27, 2015 01:12:52 PM Eli Murray wrote:
> > ERROR: syntax error at or near "json_build_object"
> > LINE 1: insert into json(data) json_build_object(SELECT DISTINCT dep...
>
> You may want to review the syntax of the INSERT command,
On Fri, Mar 27, 2015 at 12:30 PM, Eli Murray
wrote:
> Thanks to you all for the replies. Adrian, your solution is working for me
> without errors but it's not actually inserting anything. I'll keep fiddling
> with it and see if I can get what I want but I'm confident now that I'm on
> the right p
On Fri, Mar 27, 2015 at 1:55 PM, Deven Phillips
wrote:
> Better example of the problem... My FDW table schema is:
>
> CREATE FOREIGN TABLE liquorstore_backendipaddress (
> id bigint NOT NULL,
> backend_network_id bigint,
> backend_virtual_interface_id bigint,
> address character v
On Mon, Mar 30, 2015 at 1:06 PM, john.tiger
wrote:
> want to include html text from newsletters into postgres - then retrieve
>
> have seen posts saying this is really difficult (?) and others just
> sugesting pg_escape_string and pg entities -
> tried to put into text field but it seems stripped
On Sun, Mar 29, 2015 at 8:52 PM, Maulik Shah
wrote:
> Dear Sir/Madam
>
>
> how to convert float to timestamp in single select query
>
> for exp. i have float as 1.251152515236 ,
>
> i want to convert this to datetime and from datetime to timestamp...
> i.e. 02:22:044456
>
You imply that (float)
On Fri, Mar 27, 2015 at 4:18 PM, Anil Menon wrote:
> Hi,
>
> I am trying to wrap my head around a strange problem I am having. I have
> double checked the documentation but I could not find anything on this.
>
> [...]
>
> However I get no rows returned from the select statement- looks the
>
On Thu, Mar 26, 2015 at 1:49 PM, Timothy Garnett
wrote:
>
> but if that is declared strict then it would take the first non-null value
> and return A in my second example, if declared non-strict then the initial
> state would be fed as null rather then the first value. Is there a way to
> declare
On Wed, Apr 1, 2015 at 7:26 AM, Rémi Cura wrote:
> pcpatch(n) are specialization of pcpatch type.
>
While this may be true PostgreSQL doesn't understand "specialization" of
data types. If you cannot do as Steven suggested you do not get to
leverage inheritance directly and will need to devise
Adding "raw" content present on Nabble that gets filtered by the mailing
list.
On Wednesday, April 1, 2015, Taytay wrote:
> We make heavy use of `GET STACKED DIAGNOSTICS` to determine where errors
> happened.
> However, I am trying to use RAISE EXCEPTION to report errors, and have
> discovered t
On Thursday, April 2, 2015, Pavel Stehule wrote:
>
>
> 2015-04-02 9:13 GMT+02:00 David G. Johnston >:
>
>> Adding "raw" content present on Nabble that gets filtered by the mailing
>> list.
>>
>> On Wednesday, April 1, 2015, Taytay > > wrot
On Thu, Apr 2, 2015 at 10:27 AM, James Cloos wrote:
> > "SC" == Steve Crawford writes:
>
> SC> Very convoluted calculation as others have noted. As to why it is
> SC> "off", you are casting one part of the statement to an integer thus
> SC> truncating the microseconds but are not doing the s
On Thu, Apr 2, 2015 at 1:01 PM, Octavi Fors wrote:
> I don't see how to migrate the databases from my desktop directory
> determined in a) to my NAS. Could someone please provide the steps to
> accomplish that?
>
ALTER DATABASE name SET TABLESPACE new_tablespace
You are solely responsible for
On Thu, Apr 2, 2015 at 5:09 PM, Octavi Fors wrote:
> Thanks John for your extensive and helpful response.
>
> I have a NAS box. But I would worry about responsiveness. What is
>> better, IMO, is an external SATA connected DAS box. DAS is "Direct
>> Attached Storage". Many PCs have a eSATA port on
On Thu, Apr 2, 2015 at 5:24 PM, Dzmitry Nikitsin wrote:
> Hey folks,
> I have 4 postgresql servers 9.3.6(on master I use 9.3.5) configured with
> streaming replication - with 1 maser(30GB RAM, processor - Intel Xeon
> E5-2680 v2) and 3 slaves(61 Intel Xeon E5-2670 v2), all on Ubuntu 14.04.1
> L
On Thursday, April 2, 2015, Melvin Davidson wrote:
> Well right of the bat, if your master shared_buffers = 7GB and 3 slaves
> shared_buffers = 10GB, that is 37GB total, which means you are guaranteed
> to exceed the 30GB physical limit on your machine.
>
I don't get why you are adding these tog
On Fri, Apr 3, 2015 at 5:37 PM, Stefan Keller wrote:
> Hi,
>
> I'd like to get an overlap function similar to '&&' but for key-value
> pairs of hstore!
>
> This underfits:
>
> postgres=# select hstore_to_array('a=>1,b=>2,c=>3'::hstore) &&
> hstore_to_array('a=>2,d=>4,b=>2'::hstore)
>
> ...because
On Tue, Apr 7, 2015 at 3:09 PM, Jim Nasby wrote:
> On 4/7/15 4:35 PM, Tom Lane wrote:
>
>> Jim Nasby writes:
>>
>>> On 4/7/15 4:17 PM, Tom Lane wrote:
>>>
I suspect that that's only the tip of the iceberg. Remember the mess
we had with implicit casts to text? And those only existed f
On Thursday, April 9, 2015, Marc-André Goderre wrote:
> Hello all,
> I hope someone will can help me.
>
> Then, where's the difference between the result of (select
> array_agg(end_id::integer)::integer[] as id from n2) AND '{28411,25582}'
>
There isn't...though technically the former is an int
On Friday, April 10, 2015, Sameer Kumar wrote:
> On Sat, Apr 11, 2015 at 12:57 AM David G. Johnston <
> david.g.johns...@gmail.com
> > wrote:
>
>> On Fri, Apr 10, 2015 at 9:01 AM, Sameer Kumar > > wrote:
>>
>
> Yes either an upper bound to which users ca
On Sun, Apr 12, 2015 at 10:23 PM, Sameer Kumar
wrote:
>
> On Mon, Apr 13, 2015 at 1:03 PM Jim Nasby
> wrote:
>
>>
>> No. I suspect the community would support at least a hook for GUC
>> changes, if not a full-on permissions system. A hook would make it
>> fairly easy to add event trigger support
On Mon, Apr 13, 2015 at 3:05 PM, Pawel Veselov
wrote:
> Hi.
>
> If I have a table created as:
>
> CREATE TABLE xq_agr (
> idBIGSERIAL PRIMARY KEY,
> node text not null
> );
>
> and that multiple applications insert into. The applications never
> explicitly specify
On Mon, Apr 13, 2015 at 5:01 PM, Pawel Veselov
wrote:
>
> r_agrio_hourly - "good", r_agrio_total - "bad".
>
> Update on r_agrio_hourly (cost=0.42..970.32 rows=250 width=329) (actual
> time=2.248..2.248 rows=0 loops=1)
>-> Index Scan using u_r_agrio_hourly on r_agrio_hourly
> (cost=0.42..9
Hello!
Is there any non-functional difference between these two forms of Update?
WITH name AS ( SELECT )
UPDATE tbl SET ...
FROM name
WHERE tbl.id = name.id
and
UPDATE tbl SET ...
FROM ( WITH qry AS ( SELECT ) SELECT * FROM qry ) AS name
WHERE tbl.id = name.id
They both better give the same re
On Mon, Apr 13, 2015 at 7:01 PM, Jim Nasby wrote:
> On 4/13/15 7:45 PM, David G. Johnston wrote:
>
>> On Mon, Apr 13, 2015 at 3:05 PM, Pawel Veselov > <mailto:pawel.vese...@gmail.com>>wrote:
>>
>>
>> Hi.
>>
>> If I have a table cr
On Fri, Apr 17, 2015 at 8:45 AM, Melvin Davidson
wrote:
>
> On Fri, Apr 17, 2015 at 11:34 AM, Kynn Jones wrote:
>
>>
>> One consideration that is complication the choice of primary key
>> is wanting to have the ability to store chunks of the data
>> table (not the metadata table), including th
On Friday, April 17, 2015, Jim Nasby wrote:
> I'm working on a function that will return a set of test data, for unit
> testing database stuff. It does a few things, but ultimately returns SETOF
> record that's essentially:
>
> RETURN QUERY EXECUTE 'SELECT * FROM ' || table_name;
>
> Because it's
On Friday, April 17, 2015, Jim Nasby wrote:
> On 4/17/15 7:39 PM, David G. Johnston wrote:
>
>> On Friday, April 17, 2015, Jim Nasby > <mailto:jim.na...@bluetreble.com>> wrote:
>>
>> I'm working on a function that will return a set of test data, f
On Friday, April 17, 2015, Suresh Raja wrote:
> Hi all:
>
> I'm looking to write a function to send email with result of a query.
> Is it possible to send email with in a function. Any help is appreciated.
>
>
Yes...though neither the neither the sql nor the plpgsql languages have the
necessary
On Mon, Apr 20, 2015 at 7:57 AM, Merlin Moncure wrote:
> On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby
> wrote:
> > On 4/18/15 12:47 AM, David G. Johnston wrote:
> >>
> >> If you could find a way to pass a value of type some_table into the
> >> function
On Mon, Apr 20, 2015 at 9:40 AM, David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Mon, Apr 20, 2015 at 7:57 AM, Merlin Moncure
> wrote:
>
>> On Sat, Apr 18, 2015 at 5:37 PM, Jim Nasby
>> wrote:
>> > On 4/18/15 12:47 AM, David G. Johnston wrote:
&g
On Saturday, May 2, 2015, Mitu Verma wrote:
>
> still this delete operation is not working and not a single row has been
> deleted from the table.
>
>
Because of MVCC other sessions are not able to see partial deletions...and
as you aluded to knowing the data itself is not actually removed by a
d
On Sun, May 3, 2015 at 2:33 PM, Nanker Phelge wrote:
> inner ex 2 =A result was returned when none was expected.
>
>
I don't know what is or is not allowed by JDBC but it is reasonable to
assume that you cannot create batches of SELECT statements. The intent of
batching is to repeatedly execute
On Mon, May 4, 2015 at 10:23 PM, Sameer Kumar
wrote:
> Sorry about the long silence on this.
>
> On Mon, Apr 13, 2015 at 3:34 PM David G. Johnston <
> david.g.johns...@gmail.com> wrote:
>
>> On Sun, Apr 12, 2015 at 10:23 PM, Sameer Kumar
>> wrote:
>>
On Wednesday, May 6, 2015, Gunnar "Nick" Bluth
wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hello,
>
> I'm experiencing odd behaviour with a function I wrote yesterday.
>
> Background: function is supposed to deliver some "terms and
> conditions" from a table; when the "locale" is
Wednesday, May 6, 2015, Gunnar "Nick" Bluth
wrote:
> -BEGIN PGP SIGNED MESSAGE-
> CREATE OR REPLACE FUNCTION
> public.get_current_tac(userid bigint, sessionid uuid, locale character
> varying, OUT current_tac json)
> RETURNS json
> LANGUAGE sql
> IMMUTABLE STRICT SECURITY DEFINER
> AS
On Wed, May 6, 2015 at 3:37 PM, Yves Dorfsman wrote:
>
> On 9.3, is there any way to start a query, detach from the server and have
> the
> query keep going (long query that updates tables, but nothing is returned)?
>
No. Sessions require an external client to maintain its connection.
David J
On Tue, May 12, 2015 at 6:33 PM, Melvin Davidson
wrote:
> I thank everyone for their feedback regarding the omission of object
> creation date from the catalog.
>
> I do respect the various reasons for not including it, but I feel it is my
> duty to draw out this issue a bit longer.
>
> I would
On Tue, May 12, 2015 at 11:23 PM, Fabio Ugo Venchiarutti
wrote:
> Is there any cleaner way to, say, only run the validation part of a type
> input function
> [...]
>
This pre-supposes that said type input function has a distinct validation
phase as opposed to simply performing its parse and
On Wed, May 13, 2015 at 4:38 PM, Bruce Momjian wrote:
> On Wed, May 13, 2015 at 05:29:36PM -0600, Yves Dorfsman wrote:
> >
> > Is there any way to add an ON COMMIT clause to a SELECT INTO TEMP TABLE?
>
> Well CREATE TABLE has a ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP }
> clause, but I don'
On Thu, May 14, 2015 at 11:58 AM, Cory Tucker wrote:
> [pg version 9.3 or 9.4]
>
> Suppose I have a simple table:
>
> create table data (
> my_value TEXT NOT NULL
> );
> CREATE INDEX idx_my_value ON data USING gin(my_value gin_trgm_ops);
>
>
> Now I would like to essentially do group by to get
On Thu, May 14, 2015 at 1:09 PM, Cory Tucker wrote:
> That produces pretty much the same results as the CROSS JOIN I was using
> before. Because each "my_value" in the table are different, if I group on
> just their value then I will always have the full result set and a bunch of
> essentially d
Yes. The entire dump is performed within a single transaction.
On Wed, May 20, 2015 at 9:24 AM, Michael Nolan wrote:
> The documentation for pg_dump says that dump files are created in a
> consistent state.
>
> Is that true across multiple tables in the same pg_dump command?
> (Obviously it wou
On Thursday, May 21, 2015, Andomar wrote:
> Hi,
>
> Today I installed pgbouncer. I added a second installation as a hot
> standby. Before starting the standby, I configured "recovery.conf" to
> connect to pgbouncer.
>
> This results in an error message:
>
> Pooler Error: Unsupported startup
On Thursday, May 21, 2015, Daniel Torres wrote:
> I everybody, I'm new in the Postgresql world, and have an easy question:
> Is it possible to have date type data that only contain month and year?,
> how can I obtain that from a timestamp (without time zone) column?
>
> I've made this, but I thin
On Thu, May 21, 2015 at 1:33 PM, Nicolas Paris wrote:
> Hi,
>
> To me this would be great. Why not the ability to restrict lines too
> COPY stafflist (userid, username, staffid)
> FROM 'myfile.txt'
> WITH (FORMAT text, DELIMITER E'\t', COLUMNS (1, 2, 7),
> LINES(2:1000,2000:3000), ENCODING 'windo
On Thu, May 21, 2015 at 2:10 PM, Paul Jungwirth wrote:
> Anyway, I agree that you have to store the time zone *somewhere*, and I
> suppose that's the reason Joshua remarked that you really shouldn't use
> WITHOUT TIME ZONE. And often a time has one perspective that is "canonical"
> or "preferred"
On Fri, May 22, 2015 at 10:21 AM, Daniel Begin wrote:
> But how constraint exclusion would react with the following queries …
>
> b- Select * from parent_table where id between 2345 and 6789; --
> using a range of ids
>
Not sure...
These are constants but I'm not sure how smart the plann
On Sat, May 23, 2015 at 1:34 PM, Ravi Krishna
wrote:
> Is it true that PG does not log undo information, only redo. If true,
> then how does it bring a database back to consistent state during
> crash recovery. Just curious.
>
What does "undo" mean?
David J.
On Saturday, May 23, 2015, Daniel Begin wrote:
> I am working with postgresql 9.3 and I understand from the documentation
> that constraint_exclusion is set to “partition” by default. Looking at my
> postgres.conf file, the concerned line is “#constraint_exclusion =
> partition”.
>
> Furthermore,
On Saturday, May 23, 2015, Ravi Krishna wrote:
> undo means that reading the WAL logs and able to rollback a row back
> to its original state before the update. Typically it is used to
> rollback a long running transaction which got aborted due to a crash.
> Here is an example:
>
>
Not an expert
On Saturday, May 30, 2015, Glen M. Witherington wrote:
> Sorry about the horrendous subject, let me explain by example:
>
> Let's take this schema:
>
>
> ```
> CREATE TABLE a (
> id bigserial PRIMARY KEY,
> created_at timestamp with time zone NOT NULL DEFAULT NOW()
> );
>
> CREATE TABLE b(
On Wed, Jun 3, 2015 at 11:14 AM, Daniel Begin wrote:
>
> A query
>
OK...
But ma question is: What append the temp_tablespace drive get full?
>
The query, probably...
"There is also a temp_tablespaces parameter, which determines the placement
of temporary tables and indexes, as well as temp
On Mon, Jun 8, 2015 at 9:26 AM, otheus uibk wrote:
> On Mon, Jun 8, 2015 at 3:13 PM, otheus uibk wrote:
>
>> Thank you, all. The manual for 9.4 is indeed clearer on this point than
>> the 9.1 version.
>>
>
> Just to nit-pick, I see nowhere in either version of the manual the
> indication that i
On Tue, Jun 9, 2015 at 4:48 AM, Yelai, Ramkumar IN BLR STS <
ramkumar.ye...@siemens.com> wrote:
> Now, the requirement is if user provides filter information based on
> every column from the web UI, this filter will let the user construct the
> “where clause” and provide to postgresql.
> In a mon
On Thu, Jun 11, 2015 at 12:35 PM, Arup Rakshit
wrote:
> Hi,
>
> Suppose I have a column t1 for a table. Now t1 holds some numerice value
> for each row. Say R1 to R5 records has values for the column t1 as :
>
> t1(2,5,8,10,32)
>
> I want the result to be printed as (10, 32, 8, 2, 5) means - Big,
On Friday, June 12, 2015, Michael Shapiro wrote:
> Hi Melvin,
>
> Thanks for this response. It still leave my question unanswered. I should
> rephrase it -- will become a native datatype in Postgres (as
> opposed to remaining an extension). Are there any plans to make a
> native datatype?
>
In
On Friday, June 12, 2015, Michael Shapiro wrote:
>
> The reason I am asking is that, although ltree seems to have been a
> contributed module since at least 8.3, how can one know if it will always
> be part of subsequent versions of Postgres?
>
Whether contrib, core, or an external extension you
Version 9.3
CREATE TABLE t ( field numeric NULL );
SELECT * FROM json_populate_record(null::t, '{ "field": "$18,665" }'::json);
Error: invalid input syntax for type numeric: "$18,665"
I can accept the type of field being something like "numeric_cleaned" which
has a custom input function that would
On Fri, Jun 12, 2015 at 12:57 PM, Adrian Klaver
wrote:
> On 06/12/2015 09:46 AM, David G. Johnston wrote:
>
>> Version 9.3
>> CREATE TABLE t ( field numeric NULL );
>> SELECT * FROM json_populate_record(null::t, '{ "field": "$18,665"
>> }
>
>
>> I wrote that type off as something I would never code into my own
>> schema so basically forgot about its usability in other situations.
>>
>
> Though if you do not want to use the money type in a table you could do:
>
> test=> select '$18,665'::money::numeric;
> numeric
> --
> 18
On Thursday, June 18, 2015, Sven Geggus wrote:
> Hello,
>
> I supose this is simple, but I did not find a solution in the
> documentation.
>
> I would like to be able to do something like this:
>
> select myfunc('foo','bar');
> or
> select myfunc(foo, bar) from foobartable;
> or even
> select myf
On Thursday, June 18, 2015, Chris Travers wrote:
>
>
> Select (myfunc('foo','bar')).*;
>
>
>
This should be avoided. Use lateral instead,or a cte a/o offset 0.
My_func is evaluated twice (once per column) if called this way
>
> Or
> Select * from myfunc('foo','bar');
>
This is ok
David J.
On Thu, Jun 18, 2015 at 9:32 AM, Sven Geggus
wrote:
> David G. Johnston wrote:
>
> > Look at the "returns table (col1 type, col2 type)" form.
>
> If I got this right "returns table" is not what I want as I need to select
> from my function as a virtua
On Thu, Jun 18, 2015 at 9:52 AM, Sven Geggus
wrote:
> Raymond O'Donnell wrote:
>
> >> mydb=> select myfunc('foo','bar');
> >
> > You need to do:
> >
> >select * from myfunc('foo','bar');
>
> This has been a misguided example. Reality should more likely look like
> this:
>
> select myfunc(col
On Thu, Jun 18, 2015 at 10:31 AM, Sven Geggus
wrote:
> David G. Johnston wrote:
> > WITH exec_func AS ( SELECT myfunc(col1,col2) FROM mytable )
> > SELECT (exec_func.myfunc).* FROM exec_func;
> >
> > This relies on the fact that currently a CTE introduces an optim
On Thu, Jun 18, 2015 at 12:00 PM, Sven Geggus
wrote:
> David G. Johnston wrote:
>
> > Assuming you are on 9.3+ what you want to use is LATERAL
>
> OK, how is such a query supposed to look like?
>
> assuming "select myfunc(col1,col2) from mytable" wor
I know this could be written quite easily in sql but was wondering if it is
possible in pl/pgsql.
CREATE FUNCTION test_func()
RETURNS text
LANGUAGE 'plpgsql'
AS $$
BEGIN
SELECT 'text_to_return' INTO ; --with or without a cast
RETURN ;
END;
$$;
The goal is to return the value of text_to_return wit
On Sat, Jun 20, 2015 at 10:56 AM, Tom Lane wrote:
> "David G. Johnston" writes:
> > I know this could be written quite easily in sql but was wondering if it
> is
> > possible in pl/pgsql.
>
> > CREATE FUNCTION test_func()
> > RETURNS text
> >
On Wed, Jun 24, 2015 at 12:54 PM, Seb wrote:
> Hello,
>
> I've defined a function to calculate standard deviation of angular
> values:
>
> CREATE AGGREGATE public.stddev(angle_vectors) (
> SFUNC=array_append,
> STYPE=angle_vectors[],
> FINALFUNC=angle_vectors_stddev_yamartino
> );
>
> The t
On Wed, Jun 24, 2015 at 5:52 PM, Adrian Klaver
wrote:
> On 06/23/2015 11:20 PM, litu16 wrote:
>
>>
>> So, this is what I have made so far...
>>
>> *CREATE OR REPLACE FUNCTION timelog()
>>RETURNS trigger AS
>> $BODY$
>> DECLARE
>> t_ix real;
>> n int;
>>
>> BEG
On Thu, Jun 25, 2015 at 3:29 PM, John R Pierce wrote:
> On 6/25/2015 11:59 AM, Алексей Бережняк wrote:
>
>> I think that PostgreSQL is great RDBMS, but one important (for me)
>> feature that it missing is case-insensitive identifier quotes
>> ([table].[column]) like in Microsoft SQL Server.
>>
>
On Fri, Jun 26, 2015 at 9:38 AM, Tim Smith
wrote:
> I have a function that validates a web session is still active, so my
> code looks something like this :
>
> BEGIN
> perform app_security.cleanSessionTable(p_forcedTimeout,p_sessionTimeout);
> SAVEPOINT sp_cleanedSessionTable;
> select * into st
On Fri, Jun 26, 2015 at 10:48 AM, Tim Smith
wrote:
> Hi David,
>
> I should have perhaps made clear this was a saved function, so my
> understanding is ROLLBACK can't be used as its implicit.
>
I am pretty certain "ROLLBACK" cannot be used but the "ROLLBACK TO
SAVEPOINT" can - they are and do t
1 - 100 of 1209 matches
Mail list logo