Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 36927

All versions of PostgreSQL. Add an additional version-specific tag like [postgresql-13] if that context is relevant.

1 vote
1 answer
3k views

'utf-8' codec can't decode byte ERROR when querying data

servprod_sqlprod_mydb OPTIONS (table_name 'dbo.MYSQL TABLE'); When opening the table I am getting: 'utf-8' codec can't decode byte 0xd1 in position 4: invalid continuation byte I think it is a postgresql
Egidi's user avatar
  • 393
2 votes
Accepted

'utf-8' codec can't decode byte ERROR when querying data

I fixed the problem adding character_set 'UTF-8' when creating foreign server. Example: CREATE SERVER myserver FOREIGN DATA WRAPPER tds_fdw OPTIONS (servername 'localhost', port '1501',msg_handler …
Egidi's user avatar
  • 393
1 vote
0 answers
1k views

PostgreSQL trigger copy record to another table with different columns order

I can add the new field too to the _hv table but I can't reorder the fields in my postgresql version (8.4). … I know it's obsolete but I can't upgrade it right now because I have some old software that needs that version of postgresql. …
Egidi's user avatar
  • 393
-2 votes
1 answer
217 views

Postgresql - Stuck building a plpgsql function [closed]

I am a beginner in plpgsql and i am stuck coding a function. I need a function that does the following: Giving a table, a id_field in that table and another field in that table it does: ORIGINAL TAB …
Egidi's user avatar
  • 393
4 votes
1 answer
8k views

Trigger function check if all NEW.* fields exist in another table

In PostgreSQL I need to code a trigger function that checks if all the fields in NEW.* exist in another table that has the exact same name as the table that fired the trigger but appended with "_hv". …
Egidi's user avatar
  • 393
10 votes
3 answers
14k views

PostgreSQL GRANT ALL on mutliple tables using LIKE

I have more than 100 tables named public.test_* How can I easily GRANT ALL access to the user test to all that tables at once? I tried with: GRANT ALL ON TABLE public.test_* TO test; But it is no …
Egidi's user avatar
  • 393
1 vote
3 answers
1k views

Add fields to view from select (transpose fields)

I've got a table with following structure: CREATE TABLE test ( id integer, field character varying, value character varying ); field value ------ ----- field1 value1 field2 value …
Egidi's user avatar
  • 393
10 votes
2 answers
8k views

Insert RECORD into a table in a trigger function

I would like to insert a RECORD data type variable (NEW variable) into a table in a trigger. What would the SQL look like? The following attempts were unsuccessful: EXECUTE 'INSERT INTO my_table VALU …
Egidi's user avatar
  • 393