Обсуждение: function import/export pgadmin4

Поиск
Список
Период
Сортировка

function import/export pgadmin4

От
Marie-Claude Quidoz
Дата:

Hello

I am trying to test pgadmin4 version server and more particularly the functions import and export because I want to allow my users to manage their own import. 
I thought that Pgadmin4 would import localized files on my workstation (like phppgadmin) but that does not seem to be the case. 

Did I miss a configuration?

Thank you

MCQ

Re: function import/export pgadmin4

От
Melvin Davidson
Дата:
Marie,

I think the PgAdmin developers may have confused you.
The import/export function is for importing or exporting _data_
into a table.  To use it, expand a database, schema and tables and
click on a table object. You will then be able to specify export or
import to or from a local file.

If you are referring to importing an object/function, then just open
a SQL window. From there you can export sql queries or load a sql file.

Melvin Davidson 🎸
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com



On Tuesday, September 5, 2017, 5:47:22 PM EDT, Marie-Claude Quidoz <marie-claude.quidoz@cefe.cnrs.fr> wrote:


Hello

I am trying to test pgadmin4 version server and more particularly the functions import and export because I want to allow my users to manage their own import. 
I thought that Pgadmin4 would import localized files on my workstation (like phppgadmin) but that does not seem to be the case. 

Did I miss a configuration?

Thank you

MCQ

Re: function import/export pgadmin4

От
QUIDOZ Marie-Claude
Дата:
Hello

Thanks for you answer but the function ask that the csv file for exemple are on a server directory not on a local pc.

Thank you

MCQ



Envoyé depuis mon Sony Xperia SP d'Orange

---- Melvin Davidson a écrit ----

Marie,

I think the PgAdmin developers may have confused you.
The import/export function is for importing or exporting _data_
into a table.  To use it, expand a database, schema and tables and
click on a table object. You will then be able to specify export or
import to or from a local file.

If you are referring to importing an object/function, then just open
a SQL window. From there you can export sql queries or load a sql file.

Melvin Davidson ��
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com



On Tuesday, September 5, 2017, 5:47:22 PM EDT, Marie-Claude Quidoz <marie-claude.quidoz@cefe.cnrs.fr> wrote:


Hello

I am trying to test pgadmin4 version server and more particularly the functions import and export because I want to allow my users to manage their own import. 
I thought that Pgadmin4 would import localized files on my workstation (like phppgadmin) but that does not seem to be the case. 

Did I miss a configuration?

Thank you

MCQ

Re: function import/export pgadmin4

От
Marie-Claude Quidoz
Дата:

Hello

Thank you for your reply. I also noticed that in "query tool" the files must be on the server.

I confess that I don't understand the purpose of pgadmin4n, server version. I thought it was to "replace" phppgadmin but I had to make a misinterpretation

Thank you

MCQ

Le 06/09/2017 à 14:57, Melvin Davidson a écrit :
Marie,

>but the function ask that the csv file for exemple are on a server
>directory not on a local pc.

Yes, that is how it has always been and is expected to work. Just use
WinSCP or ftp to the local pc, then the file will be accessible.

Melvin Davidson 🎸

I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com



On Wednesday, September 6, 2017, 4:05:49 AM EDT, QUIDOZ Marie-Claude <Marie-claude.QUIDOZ@cefe.cnrs.fr> wrote:


Hello

Thanks for you answer but the function ask that the csv file for exemple are on a server directory not on a local pc.

Thank you

MCQ



Envoyé depuis mon Sony Xperia SP d'Orange

---- Melvin Davidson a écrit ----

Marie,

I think the PgAdmin developers may have confused you.
The import/export function is for importing or exporting _data_
into a table.  To use it, expand a database, schema and tables and
click on a table object. You will then be able to specify export or
import to or from a local file.

If you are referring to importing an object/function, then just open
a SQL window. From there you can export sql queries or load a sql file.

Melvin Davidson ��
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com



On Tuesday, September 5, 2017, 5:47:22 PM EDT, Marie-Claude Quidoz <marie-claude.quidoz@cefe.cnrs.fr> wrote:


Hello

I am trying to test pgadmin4 version server and more particularly the functions import and export because I want to allow my users to manage their own import. 
I thought that Pgadmin4 would import localized files on my workstation (like phppgadmin) but that does not seem to be the case. 

Did I miss a configuration?

Thank you

MCQ

RE: function import/export pgadmin4

От
QUIDOZ Marie-Claude
Дата:

Hello

I'm coming back with my export / import problem.

In the PGADMIN4 server version, you have programmed the COPY command. For a simple user (without right on the server), the \ COPY meta command will be more useful.


\copy { table [ ( column_list ) ] | ( query ) } { from | to } { 'filename' | program 'command' | stdin | stdout | pstdin | pstdout } [ [ with ] ( option [, ...] ) ]

Performs a frontend (client) copy. This is an operation that runs an SQL COPY command, but instead of the server reading or writing the specified file, psql reads or writes the file and routes the data between the server and the local file system. This means that file accessibility and privileges are those of the local user, not the server, and no SQL superuser privileges are required.

When program is specified, command is executed by psql and the data from or to command is routed between the server and the client. This means that the execution privileges are those of the local user, not the server, and no SQL superuser privileges are required.

\copy ... from stdin | to stdout reads/writes based on the command input and output respectively. All rows are read from the same source that issued the command, continuing until \. is read or the stream reaches EOF. Output is sent to the same place as command output. To read/write from psql's standard input or output, use pstdin or pstdout. This option is useful for populating tables in-line within a SQL script file.

The syntax of the command is similar to that of the SQL COPY command, and option must indicate one of the options of the SQL COPY command. Note that, because of this, special parsing rules apply to the \copy command. In particular, the variable substitution rules and backslash escapes do not apply.

Do you plan to develop it?

 

Thanks

 

MCQ

 

 

+++++++++++++++++

Marie-Claude QUIDOZ

CEFE / CNRS

1919, Route de Mende

34293 Montpellier Cedex 5

Tel : 04 67 61 32 39

Marie-Claude.Quidoz@cefe.cnrs.fr

http://www.cefe.cnrs.fr/fr/pf/sie

 

 

De : QUIDOZ Marie-Claude
Envoyé : mardi 12 septembre 2017 09:39
À : pgadmin-support@postgresql.org; QUIDOZ Marie-Claude <Marie-claude.QUIDOZ@cefe.cnrs.fr>
Objet : Re: function import/export pgadmin4

 

Hello

Thank you for your reply. I also noticed that in "query tool" the files must be on the server.

I confess that I don't understand the purpose of pgadmin4n, server version. I thought it was to "replace" phppgadmin but I had to make a misinterpretation

Thank you

MCQ

 

Le 06/09/2017 à 14:57, Melvin Davidson a écrit :

Marie,

 

>but the function ask that the csv file for exemple are on a server

>directory not on a local pc.

 

Yes, that is how it has always been and is expected to work. Just use

WinSCP or ftp to the local pc, then the file will be accessible.

 

Melvin Davidson 🎸

I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com

 

 

On Wednesday, September 6, 2017, 4:05:49 AM EDT, QUIDOZ Marie-Claude <Marie-claude.QUIDOZ@cefe.cnrs.fr> wrote:

 

 

Hello
 
Thanks for you answer but the function ask that the csv file for exemple are on a server directory not on a local pc.
 
Thank you
 
MCQ
 
 
 
Envoyé depuis mon Sony Xperia SP d'Orange
 
---- Melvin Davidson a écrit ----
 

Marie,

 

I think the PgAdmin developers may have confused you.

The import/export function is for importing or exporting _data_

into a table.  To use it, expand a database, schema and tables and

click on a table object. You will then be able to specify export or

import to or from a local file.

 

If you are referring to importing an object/function, then just open

a SQL window. From there you can export sql queries or load a sql file.

 

Melvin Davidson ��
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

www.youtube.com/unusedhero/videos
Folk Alley - All Folk - 24 Hours a day
www.folkalley.com

 

 

On Tuesday, September 5, 2017, 5:47:22 PM EDT, Marie-Claude Quidoz <marie-claude.quidoz@cefe.cnrs.fr> wrote:

 

 

Hello

I am trying to test pgadmin4 version server and more particularly the functions import and export because I want to allow my users to manage their own import. 
I thought that Pgadmin4 would import localized files on my workstation (like phppgadmin) but that does not seem to be the case. 
 
Did I miss a configuration?
 
Thank you
 
MCQ

 

Re: function import/export pgadmin4

От
"David G. Johnston"
Дата:
On Tue, Dec 19, 2017 at 10:42 AM, QUIDOZ Marie-Claude <Marie-claude.QUIDOZ@cefe.cnrs.fr> wrote:

In the PGADMIN4 server version, you have programmed the COPY command. For a simple user (without right on the server), the \ COPY meta command will be more useful.


​pgAdmin should (I've only used it minimally and not v4) indeed implement file export/import via SQL "COPY" (and a custom UI, not a query window) - and would arrange for the proper command syntax and making the relevant data available on the server's stdin (COPY FROM) or take the server's response via stdout (COPY TO) and turn it into a file for you.

If you simply type "COPY" into a SQL query window and send it to the server pgAdmin probably doesn't do anything special and you end up with whatever normal behavior such a copy would entail.  That probably includes placing non-SQL text (i.e., csv data) into the query screen and sending it to the server for processing - just like you can in a psql script (i.e., COPY in psql works with inline data).

pgAdmin doesn't have a text/CLI language that would control the application like psql does.  Adding it simply for "\copy" is likely to fail a cost/benefit analysis.​

In short, you can (probably) do everything you need to with the tools as they exist today.  You might need to learn more about how they work, though.

David J.